VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{8E27C92E-1264-101C-8A2F-040224009C02}#7.0#0"; "MSCAL.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Object = "{20C62CAE-15DA-101B-B9A8-444553540000}#1.1#0"; "MSMAPI32.OCX"
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Object = "{E5CEE37F-8CF8-489E-BFA0-8201CBD6AEE8}#1.0#0"; "PicFormat32.ocx"
Begin VB.Form frmMain 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Motor Accident Assessment Program"
   ClientHeight    =   7425
   ClientLeft      =   45
   ClientTop       =   825
   ClientWidth     =   11970
   Icon            =   "frmAssessment.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   7425
   ScaleWidth      =   11970
   StartUpPosition =   2  'CenterScreen
   Begin VB.Frame frmAssessment 
      Height          =   6855
      Left            =   2760
      TabIndex        =   0
      Top             =   360
      Width           =   9015
      Begin MSACAL.Calendar calASS_DATE_AUTHORISED 
         Height          =   2175
         Left            =   1800
         TabIndex        =   209
         TabStop         =   0   'False
         Top             =   3720
         Width           =   2295
         _Version        =   524288
         _ExtentX        =   4048
         _ExtentY        =   3836
         _StockProps     =   1
         BackColor       =   -2147483633
         Year            =   2006
         Month           =   1
         Day             =   22
         DayLength       =   2
         MonthLength     =   2
         DayFontColor    =   0
         FirstDay        =   7
         GridCellEffect  =   1
         GridFontColor   =   10485760
         GridLinesColor  =   -2147483632
         ShowDateSelectors=   -1  'True
         ShowDays        =   -1  'True
         ShowHorizontalGrid=   -1  'True
         ShowTitle       =   0   'False
         ShowVerticalGrid=   -1  'True
         TitleFontColor  =   10485760
         ValueIsNull     =   0   'False
         BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.TextBox txtASS_REPAIRER_FAX 
         Height          =   285
         Left            =   4320
         TabIndex        =   34
         Text            =   "ASS_REPAIRER_FAX"
         Top             =   5400
         Width           =   1455
      End
      Begin MSACAL.Calendar Calendar2 
         Height          =   2055
         Left            =   1440
         TabIndex        =   201
         TabStop         =   0   'False
         Top             =   240
         Width           =   2295
         _Version        =   524288
         _ExtentX        =   4048
         _ExtentY        =   3625
         _StockProps     =   1
         BackColor       =   -2147483633
         Year            =   2005
         Month           =   3
         Day             =   7
         DayLength       =   0
         MonthLength     =   0
         DayFontColor    =   0
         FirstDay        =   1
         GridCellEffect  =   1
         GridFontColor   =   10485760
         GridLinesColor  =   -2147483632
         ShowDateSelectors=   -1  'True
         ShowDays        =   -1  'True
         ShowHorizontalGrid=   -1  'True
         ShowTitle       =   0   'False
         ShowVerticalGrid=   -1  'True
         TitleFontColor  =   10485760
         ValueIsNull     =   0   'False
         BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin MSACAL.Calendar Calendar3 
         Height          =   2055
         Left            =   4320
         TabIndex        =   202
         TabStop         =   0   'False
         Top             =   240
         Width           =   2295
         _Version        =   524288
         _ExtentX        =   4048
         _ExtentY        =   3625
         _StockProps     =   1
         BackColor       =   -2147483633
         Year            =   2005
         Month           =   3
         Day             =   7
         DayLength       =   0
         MonthLength     =   0
         DayFontColor    =   0
         FirstDay        =   1
         GridCellEffect  =   1
         GridFontColor   =   10485760
         GridLinesColor  =   -2147483632
         ShowDateSelectors=   -1  'True
         ShowDays        =   -1  'True
         ShowHorizontalGrid=   -1  'True
         ShowTitle       =   0   'False
         ShowVerticalGrid=   -1  'True
         TitleFontColor  =   10485760
         ValueIsNull     =   0   'False
         BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.ComboBox cmbFOR_BRA_BRANCH 
         Height          =   315
         Left            =   3960
         Style           =   2  'Dropdown List
         TabIndex        =   7
         Top             =   720
         Width           =   2175
      End
      Begin VB.CommandButton cmdClearDOL 
         Caption         =   "X"
         Height          =   255
         Left            =   3000
         TabIndex        =   227
         TabStop         =   0   'False
         Top             =   3000
         Width           =   255
      End
      Begin VB.ComboBox cmbFOR_ASO_ASSESOR 
         Height          =   315
         Left            =   7080
         Style           =   2  'Dropdown List
         TabIndex        =   37
         Top             =   4680
         Width           =   1575
      End
      Begin VB.ComboBox cmbFOR_CLR_CLARK 
         Height          =   315
         Left            =   6720
         Style           =   2  'Dropdown List
         TabIndex        =   8
         Top             =   720
         Width           =   1935
      End
      Begin VB.ComboBox cmbFOR_INS_INSURANCE 
         Height          =   315
         Left            =   1080
         Style           =   2  'Dropdown List
         TabIndex        =   6
         Top             =   720
         Width           =   2055
      End
      Begin VB.ComboBox cmbASS_VEHICLE_STATE 
         Height          =   315
         Left            =   1800
         Style           =   2  'Dropdown List
         TabIndex        =   21
         Top             =   4080
         Width           =   1935
      End
      Begin VB.TextBox txtASS_DATE_AUTHORISED 
         BackColor       =   &H80000004&
         Height          =   285
         Left            =   1800
         Locked          =   -1  'True
         TabIndex        =   22
         TabStop         =   0   'False
         Text            =   "ASS_DATE_AUTHORISED"
         Top             =   3720
         Width           =   1935
      End
      Begin VB.TextBox txtFOR_INS_VAT_NO 
         BackColor       =   &H80000004&
         Height          =   285
         Left            =   1080
         Locked          =   -1  'True
         TabIndex        =   26
         TabStop         =   0   'False
         Text            =   "VAT_NO"
         Top             =   1080
         Width           =   2055
      End
      Begin VB.CheckBox chkASS_AUTHORISED 
         Alignment       =   1  'Right Justify
         Caption         =   "Authorise"
         Height          =   255
         Left            =   600
         TabIndex        =   20
         Top             =   3720
         Width           =   1095
      End
      Begin VB.CheckBox chkASS_AGREE 
         Alignment       =   1  'Right Justify
         Caption         =   "Agree Only"
         Height          =   255
         Left            =   480
         TabIndex        =   19
         Top             =   3360
         Width           =   1215
      End
      Begin VB.TextBox txtASS_VEHICLE_NAME 
         Height          =   285
         Left            =   1440
         TabIndex        =   27
         Text            =   "ASS_VEHICLE_NAME"
         Top             =   4680
         Width           =   1455
      End
      Begin VB.TextBox txtASS_REPAIRER 
         Height          =   285
         Left            =   4320
         TabIndex        =   32
         Text            =   "ASS_REPAIRER"
         Top             =   4680
         Width           =   1455
      End
      Begin VB.TextBox txtASS_VEHICLE_MAKE 
         Height          =   285
         Left            =   1440
         TabIndex        =   28
         Text            =   "ASS_VEHICLE_MAKE"
         Top             =   5040
         Width           =   1455
      End
      Begin VB.TextBox txtASS_REPAIRER_TEL 
         Height          =   285
         Left            =   4320
         TabIndex        =   33
         Text            =   "ASS_REPAIRER_TEL_NO"
         Top             =   5040
         Width           =   1455
      End
      Begin VB.TextBox txtFOR_ASO_TEL 
         BackColor       =   &H80000004&
         Height          =   285
         Left            =   7080
         Locked          =   -1  'True
         TabIndex        =   38
         TabStop         =   0   'False
         Text            =   "ASS_ASSESSOR_TEL"
         Top             =   5040
         Width           =   1575
      End
      Begin VB.TextBox txtASS_VEHICLE_MODEL 
         Height          =   285
         Left            =   1440
         TabIndex        =   29
         Text            =   "ASS_VEHICLE_MODEL"
         Top             =   5400
         Width           =   1455
      End
      Begin VB.TextBox txtASS_REPAIRER_CONTACT 
         Height          =   285
         Left            =   4320
         TabIndex        =   35
         Text            =   "ASS_REPAIRER_CONTACT"
         Top             =   5760
         Width           =   4335
      End
      Begin VB.TextBox txtASS_VEHICLE_YEAR 
         Height          =   285
         Left            =   1440
         TabIndex        =   30
         Text            =   "ASS_VEHICLE_YEAR"
         Top             =   5760
         Width           =   1455
      End
      Begin VB.TextBox txtASS_VEHICLE_LOCATION 
         Height          =   285
         Left            =   4320
         TabIndex        =   36
         Text            =   "ASS_VEHICLE_LOCATION"
         Top             =   6120
         Width           =   4335
      End
      Begin VB.TextBox txtASS_VEHICLE_REGISTRATION 
         Height          =   285
         Left            =   1440
         TabIndex        =   31
         Text            =   "ASS_VEHICLE_REGISTRATION"
         Top             =   6120
         Width           =   1455
      End
      Begin VB.TextBox txtASS_EXCESS_1 
         Height          =   285
         Left            =   4320
         TabIndex        =   25
         Text            =   "ASS_EXCESS_1"
         Top             =   3360
         Width           =   4335
      End
      Begin VB.TextBox txtASS_DATE_OF_LOSS 
         Height          =   285
         Left            =   1440
         TabIndex        =   18
         Text            =   "ASS_DATE_OF_LOSS"
         Top             =   3000
         Width           =   1455
      End
      Begin VB.TextBox txtASS_DESCRIPTION_OF_LOSS 
         Height          =   615
         Left            =   4320
         MultiLine       =   -1  'True
         TabIndex        =   24
         Text            =   "frmAssessment.frx":57E2
         Top             =   2640
         Width           =   4335
      End
      Begin VB.TextBox txtASS_SUM_INSURED 
         Height          =   285
         Left            =   1440
         TabIndex        =   17
         Text            =   "ASS_SUM_INSURED"
         Top             =   2640
         Width           =   1455
      End
      Begin VB.TextBox txtASS_CELL_NO_2 
         Height          =   285
         Left            =   7080
         TabIndex        =   16
         Text            =   "ASS_CELL_NO_2"
         Top             =   2280
         Width           =   1575
      End
      Begin VB.TextBox txtASS_TEL_NO_2 
         Height          =   285
         Left            =   4320
         TabIndex        =   15
         Text            =   "ASS_TEL_NO_2"
         Top             =   2280
         Width           =   1455
      End
      Begin VB.TextBox txtASS_THIRD_PARTY 
         Height          =   285
         Left            =   1440
         TabIndex        =   14
         Text            =   "ASS_THIRD_PARTY"
         Top             =   2280
         Width           =   1455
      End
      Begin VB.TextBox txtASS_CELL_NO 
         Height          =   285
         Left            =   7080
         TabIndex        =   13
         Text            =   "ASS_CELL_NO"
         Top             =   1920
         Width           =   1575
      End
      Begin VB.TextBox txtASS_TEL_NO 
         Height          =   285
         Left            =   4320
         TabIndex        =   12
         Text            =   "ASS_TEL_NO"
         Top             =   1920
         Width           =   1455
      End
      Begin VB.TextBox txtASS_INSURANCE_POLICY_NO 
         Height          =   285
         Left            =   3960
         TabIndex        =   10
         Text            =   "ASS_INSURANCE_POLICY_NO"
         Top             =   1440
         Width           =   2175
      End
      Begin VB.TextBox txtASS_INSURANCE_CLAIM_NO 
         Height          =   285
         Left            =   1080
         TabIndex        =   9
         Text            =   "ASS_INSURANCE_CLAIM_NO"
         Top             =   1440
         Width           =   2055
      End
      Begin VB.TextBox txtFOR_CLR_TEL 
         BackColor       =   &H80000004&
         Height          =   285
         Left            =   6720
         Locked          =   -1  'True
         TabIndex        =   3
         TabStop         =   0   'False
         Text            =   "FOR_CLR_TEL"
         Top             =   1080
         Width           =   1935
      End
      Begin VB.TextBox txtASS_INVOICE_NO 
         Height          =   285
         Left            =   7080
         TabIndex        =   5
         Text            =   "ASS_INVOICE_NUMBER"
         Top             =   240
         Width           =   1575
      End
      Begin VB.TextBox txtASS_DATE_ASSESSED 
         Height          =   285
         Left            =   4320
         TabIndex        =   4
         TabStop         =   0   'False
         Text            =   "ASS_DATE_ASSESSED"
         Top             =   240
         Width           =   1455
      End
      Begin VB.TextBox txtASS_DATE_INSTRUCTED 
         Height          =   285
         Left            =   1440
         TabIndex        =   2
         TabStop         =   0   'False
         Text            =   "ASS_DATE_INSTRUCTED"
         Top             =   240
         Width           =   1455
      End
      Begin VB.TextBox txtASS_INSURED 
         Height          =   285
         Left            =   1440
         TabIndex        =   11
         Text            =   "ASS_INSURED"
         Top             =   1920
         Width           =   1455
      End
      Begin MSForms.Label lblASS_REPAIRER_FAX 
         Height          =   255
         Left            =   3000
         TabIndex        =   228
         Top             =   5400
         Width           =   1215
         Caption         =   "Repairer Fax"
         Size            =   "2143;450"
         FontHeight      =   165
         FontCharSet     =   0
         FontPitchAndFamily=   2
         ParagraphAlign  =   2
      End
      Begin VB.Label lblASS_INSURANCE_BRANCH 
         Alignment       =   1  'Right Justify
         Caption         =   "Branch"
         Height          =   255
         Left            =   3240
         TabIndex        =   114
         Top             =   720
         Width           =   615
      End
      Begin VB.Label lblASS_INSURANCE_CLARK 
         Alignment       =   1  'Right Justify
         Caption         =   "Clark"
         Height          =   255
         Left            =   6120
         TabIndex        =   115
         Top             =   720
         Width           =   495
      End
      Begin VB.Label lblASS_VEHICLES_STATE 
         Alignment       =   1  'Right Justify
         Caption         =   "Vehicle's State"
         Height          =   255
         Left            =   120
         TabIndex        =   23
         Top             =   4080
         Width           =   1575
      End
      Begin VB.Label lblASS_VAT_NO 
         Alignment       =   1  'Right Justify
         Caption         =   "Vat No"
         Height          =   255
         Left            =   240
         TabIndex        =   203
         Top             =   1080
         Width           =   735
      End
      Begin VB.Label lblASS_INSURED 
         Alignment       =   1  'Right Justify
         Caption         =   "Insured"
         Height          =   255
         Left            =   120
         TabIndex        =   198
         Top             =   1920
         Width           =   1215
      End
      Begin VB.Label lblASS_VEHICLE 
         Alignment       =   1  'Right Justify
         Caption         =   "Vehicle"
         Height          =   255
         Left            =   120
         TabIndex        =   165
         Top             =   4680
         Width           =   1215
      End
      Begin VB.Label lblASS_REPAIRER 
         Alignment       =   1  'Right Justify
         Caption         =   "Repairer"
         Height          =   255
         Left            =   3000
         TabIndex        =   164
         Top             =   4680
         Width           =   1215
      End
      Begin VB.Label lblASS_ASSESSOR 
         Alignment       =   1  'Right Justify
         Caption         =   "Assessor"
         Height          =   255
         Left            =   5880
         TabIndex        =   163
         Top             =   4680
         Width           =   1095
      End
      Begin VB.Label lblASS_VEHICLE_MAKE 
         Alignment       =   1  'Right Justify
         Caption         =   "Make"
         Height          =   255
         Left            =   120
         TabIndex        =   162
         Top             =   5040
         Width           =   1215
      End
      Begin VB.Label lblASS_REPAIRER_TEL_NO 
         Alignment       =   1  'Right Justify
         Caption         =   "Repairer Tel"
         Height          =   255
         Left            =   3000
         TabIndex        =   161
         Top             =   5040
         Width           =   1215
      End
      Begin VB.Label lblASS_ASSESSOR_TEL 
         Alignment       =   1  'Right Justify
         Caption         =   "Assessor Tel"
         Height          =   255
         Left            =   5880
         TabIndex        =   160
         Top             =   5040
         Width           =   1095
      End
      Begin VB.Label lblASS_VEHICLE_MODEL 
         Alignment       =   1  'Right Justify
         Caption         =   "Model"
         Height          =   255
         Left            =   120
         TabIndex        =   159
         Top             =   5400
         Width           =   1215
      End
      Begin VB.Label lblASS_REPAIRER_CONTACT 
         Alignment       =   1  'Right Justify
         Caption         =   "Repairer Contact"
         Height          =   255
         Left            =   3000
         TabIndex        =   158
         Top             =   5760
         Width           =   1215
      End
      Begin VB.Label lblASS_VEHICLE_YEAR 
         Alignment       =   1  'Right Justify
         Caption         =   "Year"
         Height          =   255
         Left            =   120
         TabIndex        =   157
         Top             =   5760
         Width           =   1215
      End
      Begin VB.Label lblASS_VEHICLE_LOCATION 
         Alignment       =   1  'Right Justify
         Caption         =   "Vehicle Location"
         Height          =   255
         Left            =   3000
         TabIndex        =   156
         Top             =   6120
         Width           =   1215
      End
      Begin VB.Label lblASS_VEHICLE_REGISTRATION 
         Alignment       =   1  'Right Justify
         Caption         =   "Reg No"
         Height          =   255
         Left            =   120
         TabIndex        =   155
         Top             =   6120
         Width           =   1215
      End
      Begin VB.Label lblASS_EXCESS_1 
         Alignment       =   1  'Right Justify
         Caption         =   "Excess"
         Height          =   255
         Left            =   3000
         TabIndex        =   127
         Top             =   3360
         Width           =   1215
      End
      Begin VB.Label lblASS_DATE_OF_LOSS 
         Alignment       =   1  'Right Justify
         Caption         =   "Date of loss"
         Height          =   255
         Left            =   120
         TabIndex        =   126
         Top             =   3000
         Width           =   1215
      End
      Begin VB.Line Line3 
         X1              =   120
         X2              =   8640
         Y1              =   4560
         Y2              =   4560
      End
      Begin VB.Label lblASS_DESCRIPTION_OF_LOSS 
         Alignment       =   1  'Right Justify
         Caption         =   "Description of loss"
         Height          =   255
         Left            =   2880
         TabIndex        =   125
         Top             =   2640
         Width           =   1335
      End
      Begin VB.Label lblASS_SUM_INSURED 
         Alignment       =   1  'Right Justify
         Caption         =   "Sum Insured"
         Height          =   255
         Left            =   120
         TabIndex        =   124
         Top             =   2640
         Width           =   1215
      End
      Begin VB.Label lblASS_CELL_NO_2 
         Alignment       =   1  'Right Justify
         Caption         =   "Cell No"
         Height          =   255
         Left            =   5760
         TabIndex        =   123
         Top             =   2280
         Width           =   1215
      End
      Begin VB.Label lblASS_TEL_NO_2 
         Alignment       =   1  'Right Justify
         Caption         =   "Tel No"
         Height          =   255
         Left            =   3120
         TabIndex        =   122
         Top             =   2280
         Width           =   1095
      End
      Begin VB.Label lblASS_THIRD_PARTY 
         Alignment       =   1  'Right Justify
         Caption         =   "Third party"
         Height          =   255
         Left            =   120
         TabIndex        =   121
         Top             =   2280
         Width           =   1215
      End
      Begin VB.Label lblASS_CELL_NO 
         Alignment       =   1  'Right Justify
         Caption         =   "Cell No"
         Height          =   255
         Left            =   5640
         TabIndex        =   120
         Top             =   1920
         Width           =   1335
      End
      Begin VB.Label lblASS_TEL_NO 
         Alignment       =   1  'Right Justify
         Caption         =   "Tel No"
         Height          =   255
         Left            =   3120
         TabIndex        =   119
         Top             =   1920
         Width           =   1095
      End
      Begin VB.Line Line2 
         X1              =   120
         X2              =   8640
         Y1              =   1800
         Y2              =   1800
      End
      Begin VB.Label lblASS_INSURANCE_POLICY_NO 
         Alignment       =   1  'Right Justify
         Caption         =   "Policy No"
         Height          =   255
         Left            =   3120
         TabIndex        =   118
         Top             =   1440
         Width           =   735
      End
      Begin VB.Label lblASS_INSURANCE_CLAIM_NO 
         Alignment       =   1  'Right Justify
         Caption         =   "Claim No"
         Height          =   255
         Left            =   120
         TabIndex        =   117
         Top             =   1440
         Width           =   855
      End
      Begin VB.Label lblASS_INSURANCE_TEL 
         Alignment       =   1  'Right Justify
         Caption         =   "Tel No"
         Height          =   255
         Left            =   5760
         TabIndex        =   116
         Top             =   1080
         Width           =   855
      End
      Begin VB.Label lblASS_INSURANCE 
         Alignment       =   1  'Right Justify
         Caption         =   "Insurance"
         Height          =   255
         Left            =   120
         TabIndex        =   113
         Top             =   720
         Width           =   855
      End
      Begin VB.Line Line1 
         X1              =   120
         X2              =   8640
         Y1              =   600
         Y2              =   600
      End
      Begin VB.Label lblASS_INVOICE_NUMBER 
         Alignment       =   1  'Right Justify
         Caption         =   "Invoice Number"
         Height          =   255
         Left            =   5760
         TabIndex        =   112
         Top             =   240
         Width           =   1215
      End
      Begin VB.Label lblASS_DATE_ASSESSED 
         Alignment       =   1  'Right Justify
         Caption         =   "Date Assessed"
         Height          =   255
         Left            =   3000
         TabIndex        =   111
         Top             =   240
         Width           =   1095
      End
      Begin VB.Label lblASS_DATE_INSTRUCTED 
         Alignment       =   1  'Right Justify
         Caption         =   "Date Instructed"
         Height          =   255
         Left            =   120
         TabIndex        =   110
         Top             =   240
         Width           =   1215
      End
   End
   Begin VB.Frame frmCosting 
      Height          =   6855
      Left            =   2760
      TabIndex        =   154
      Top             =   360
      Width           =   9015
      Begin MSACAL.Calendar calASS_PAID_DATE 
         Height          =   2055
         Left            =   2040
         TabIndex        =   206
         TabStop         =   0   'False
         Top             =   2520
         Width           =   2295
         _Version        =   524288
         _ExtentX        =   4048
         _ExtentY        =   3625
         _StockProps     =   1
         BackColor       =   -2147483633
         Year            =   2006
         Month           =   1
         Day             =   21
         DayLength       =   2
         MonthLength     =   2
         DayFontColor    =   0
         FirstDay        =   7
         GridCellEffect  =   1
         GridFontColor   =   10485760
         GridLinesColor  =   -2147483632
         ShowDateSelectors=   -1  'True
         ShowDays        =   -1  'True
         ShowHorizontalGrid=   -1  'True
         ShowTitle       =   0   'False
         ShowVerticalGrid=   -1  'True
         TitleFontColor  =   10485760
         ValueIsNull     =   0   'False
         BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.TextBox txtASS_PAID_DATE 
         Height          =   285
         Left            =   2040
         TabIndex        =   103
         Text            =   "ASS_DATE_PAID"
         Top             =   2520
         Width           =   1575
      End
      Begin VB.CheckBox chkASS_PAID 
         Alignment       =   1  'Right Justify
         Caption         =   "Invoice Paid"
         Height          =   195
         Left            =   240
         TabIndex        =   102
         Top             =   2520
         Width           =   1695
      End
      Begin VB.TextBox txtASS_RATE_PER_KILOMETER 
         Height          =   285
         Left            =   1440
         TabIndex        =   100
         Text            =   "ASS_RATE_PER_KILOMETER"
         Top             =   720
         Width           =   495
      End
      Begin VB.TextBox txtASS_ASSESS_KILOMETRES 
         Height          =   285
         Left            =   2160
         TabIndex        =   101
         Text            =   "ASS_ASSESS_KILOMETRES"
         Top             =   720
         Width           =   495
      End
      Begin VB.TextBox txtASS_ASSESS_TOTAL 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000004&
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         TabIndex        =   107
         TabStop         =   0   'False
         Text            =   "ASS_ASSESS_TOTAL"
         Top             =   1800
         Width           =   1575
      End
      Begin VB.TextBox txtASS_ASSESS_VAT 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000004&
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         TabIndex        =   106
         TabStop         =   0   'False
         Text            =   "ASS_ASSESS_VAT"
         Top             =   1440
         Width           =   1575
      End
      Begin VB.TextBox txtASS_ASSESS_SUB_TOTAL 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000004&
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         TabIndex        =   105
         TabStop         =   0   'False
         Text            =   "ASS_SUB_TOTAL"
         Top             =   1080
         Width           =   1575
      End
      Begin VB.TextBox txtASS_ASSESS_KILOMETRES_COST 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000004&
         Height          =   285
         Left            =   2760
         Locked          =   -1  'True
         TabIndex        =   104
         TabStop         =   0   'False
         Text            =   "ASS_ASSESS_KILOMETRES_COST"
         Top             =   720
         Width           =   1575
      End
      Begin VB.TextBox txtASS_ASSESS_RATE 
         Alignment       =   1  'Right Justify
         Height          =   285
         Left            =   2760
         TabIndex        =   99
         Text            =   "ASS_ASSESS_RATE"
         Top             =   360
         Width           =   1575
      End
      Begin VB.Line Line8 
         X1              =   240
         X2              =   8520
         Y1              =   2280
         Y2              =   2280
      End
      Begin VB.Label lblASS_ASSESS_TOTAL 
         Alignment       =   1  'Right Justify
         Caption         =   "Total"
         Height          =   255
         Left            =   240
         TabIndex        =   197
         Top             =   1800
         Width           =   2415
      End
      Begin VB.Label lblASS_ASSESS_VAT 
         Alignment       =   1  'Right Justify
         Caption         =   "V.A.T."
         Height          =   255
         Left            =   240
         TabIndex        =   196
         Top             =   1440
         Width           =   2415
      End
      Begin VB.Label lblASS_ASSESS_SUB_TOTAL 
         Alignment       =   1  'Right Justify
         Caption         =   "Sub Total"
         Height          =   255
         Left            =   240
         TabIndex        =   195
         Top             =   1080
         Width           =   2415
      End
      Begin VB.Label lblASS_ASSESS_KILOMETRES 
         Alignment       =   1  'Right Justify
         Caption         =   "Kilometres @ R"
         Height          =   255
         Left            =   120
         TabIndex        =   194
         Top             =   720
         Width           =   1215
      End
      Begin VB.Label lblASS_ASSESS_RATE 
         Alignment       =   1  'Right Justify
         Caption         =   "Assessment Rate"
         Height          =   255
         Left            =   240
         TabIndex        =   193
         Top             =   360
         Width           =   2415
      End
   End
   Begin VB.Frame frmVehicle 
      Height          =   6855
      Left            =   2760
      TabIndex        =   128
      Top             =   360
      Width           =   9015
      Begin VB.TextBox txtASS_BOOK_IN_DATE 
         Height          =   285
         Left            =   7080
         TabIndex        =   87
         Text            =   "ASS_BOOK_IN_DATE"
         Top             =   6240
         Width           =   1575
      End
      Begin VB.TextBox txtASS_EXTRA_SUN_ROOF_TEXT 
         Height          =   285
         Left            =   1680
         MultiLine       =   -1  'True
         TabIndex        =   58
         Top             =   3240
         Width           =   1815
      End
      Begin VB.TextBox txtASS_EXTRA_MAGS_TEXT 
         Height          =   285
         Left            =   1680
         MultiLine       =   -1  'True
         TabIndex        =   56
         Top             =   2880
         Width           =   1815
      End
      Begin VB.CheckBox chkASS_EXTRA_SUN_ROOF 
         Caption         =   "S/Roof"
         Height          =   255
         Left            =   720
         TabIndex        =   57
         Top             =   3240
         Width           =   975
      End
      Begin VB.CheckBox chkASS_EXTRA_MAGS 
         Caption         =   "Mags"
         Height          =   255
         Left            =   720
         TabIndex        =   55
         Top             =   2880
         Width           =   975
      End
      Begin VB.TextBox txtASS_VAT 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000004&
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   7080
         Locked          =   -1  'True
         TabIndex        =   81
         TabStop         =   0   'False
         Text            =   "ASS_VAT"
         Top             =   4080
         Width           =   1575
      End
      Begin VB.TextBox txtASS_ADDITIONALS 
         Alignment       =   1  'Right Justify
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   4560
         TabIndex        =   76
         Text            =   "ASS_ADITONALS"
         Top             =   5160
         Width           =   1455
      End
      Begin VB.TextBox txtASS_SAVINGS 
         Alignment       =   1  'Right Justify
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   4560
         TabIndex        =   75
         Text            =   "ASS_SAVINGS"
         Top             =   4800
         Width           =   1455
      End
      Begin VB.TextBox txtASS_WORK_DAYS 
         Alignment       =   1  'Right Justify
         Height          =   285
         Left            =   7080
         TabIndex        =   86
         Text            =   "ASS_WORK_DAYS"
         Top             =   5880
         Width           =   1575
      End
      Begin VB.TextBox txtASS_QUOTE_NO 
         Alignment       =   1  'Right Justify
         Height          =   285
         Left            =   7080
         TabIndex        =   85
         Text            =   "ASS_QUOTE_NO"
         Top             =   5520
         Width           =   1575
      End
      Begin VB.TextBox txtASS_TOTAL 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000004&
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   7080
         Locked          =   -1  'True
         TabIndex        =   84
         TabStop         =   0   'False
         Text            =   "ASS_TOTAL"
         Top             =   5160
         Width           =   1575
      End
      Begin VB.TextBox txtASS_EXCESS 
         Alignment       =   1  'Right Justify
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   7080
         TabIndex        =   83
         Text            =   "ASS_EXCESS"
         Top             =   4800
         Width           =   1575
      End
      Begin VB.TextBox txtASS_SUB_TOTAL_2 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000004&
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   7080
         Locked          =   -1  'True
         TabIndex        =   82
         TabStop         =   0   'False
         Text            =   "ASS_SUB_TOTAL_2"
         Top             =   4440
         Width           =   1575
      End
      Begin VB.TextBox txtASS_SUB_TOTAL_1 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000004&
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   4560
         Locked          =   -1  'True
         TabIndex        =   80
         TabStop         =   0   'False
         Text            =   "ASS_SUB_TOTAL_1"
         Top             =   6240
         Width           =   1455
      End
      Begin VB.TextBox txtASS_BETTERMENT 
         Alignment       =   1  'Right Justify
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   4560
         TabIndex        =   79
         Text            =   "ASS_BETTERMENT"
         Top             =   5880
         Width           =   1455
      End
      Begin VB.TextBox txtASS_DISCOUNT_PERC 
         BeginProperty DataFormat 
            Type            =   1
            Format          =   "0%"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   5
         EndProperty
         Height          =   285
         Left            =   4560
         TabIndex        =   77
         Text            =   "ASS_DISCOUNT_PERC"
         Top             =   5520
         Width           =   375
      End
      Begin VB.TextBox txtASS_DISCOUNT 
         Alignment       =   1  'Right Justify
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   5040
         TabIndex        =   78
         Text            =   "ASS_DISCOUNT"
         Top             =   5520
         Width           =   975
      End
      Begin VB.TextBox txtASS_AMOUNT_AGREED 
         Alignment       =   1  'Right Justify
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   4560
         TabIndex        =   74
         Text            =   "ASS_AMOUNT_AGREED"
         Top             =   4440
         Width           =   1455
      End
      Begin VB.TextBox txtASS_KILOMETRE 
         Alignment       =   1  'Right Justify
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   2280
         TabIndex        =   71
         Text            =   "ASS_KILOMETRE"
         Top             =   5880
         Width           =   975
      End
      Begin VB.TextBox txtASS_MARKET 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000004&
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   1800
         Locked          =   -1  'True
         TabIndex        =   72
         TabStop         =   0   'False
         Text            =   "ASS_MARKET"
         Top             =   6240
         Width           =   1455
      End
      Begin VB.TextBox txtASS_OLD_DAMAGE 
         Alignment       =   1  'Right Justify
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   1800
         TabIndex        =   69
         Text            =   "ASS_OLD_DAMAGE1"
         Top             =   5520
         Width           =   1455
      End
      Begin VB.TextBox txtASS_KILOMETRE_PERC 
         BeginProperty DataFormat 
            Type            =   1
            Format          =   "0%"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   5
         EndProperty
         Height          =   285
         Left            =   1800
         TabIndex        =   70
         Text            =   "ASS_KILOMETRE_PERC"
         Top             =   5880
         Width           =   375
      End
      Begin VB.TextBox txtASS_RETAIL 
         Alignment       =   1  'Right Justify
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   1800
         TabIndex        =   68
         Text            =   "ASS_RETAIL"
         Top             =   5160
         Width           =   1455
      End
      Begin VB.TextBox txtASS_TRADE_IN 
         Alignment       =   1  'Right Justify
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   1800
         TabIndex        =   67
         Text            =   "ASS_TRADE_IN"
         Top             =   4800
         Width           =   1455
      End
      Begin VB.TextBox txtASS_TREAD_SPARE 
         Height          =   285
         Left            =   4560
         TabIndex        =   64
         Text            =   "ASS_TREAD_SPARE"
         Top             =   3600
         Width           =   1455
      End
      Begin VB.TextBox txtASS_TREAD_RR 
         Height          =   285
         Left            =   4560
         TabIndex        =   63
         Text            =   "ASS_TREAD_RR"
         Top             =   3240
         Width           =   1455
      End
      Begin VB.TextBox txtASS_TREAD_LR 
         Height          =   285
         Left            =   4560
         TabIndex        =   62
         Text            =   "ASS_TREAD_LR"
         Top             =   2880
         Width           =   1455
      End
      Begin VB.TextBox txtASS_TYRE_SIZE 
         Height          =   285
         Left            =   7080
         TabIndex        =   66
         Text            =   "ASS_TYRE_SIZE"
         Top             =   2520
         Width           =   1575
      End
      Begin VB.TextBox txtASS_TREAD_LF 
         Height          =   285
         Left            =   4560
         TabIndex        =   61
         Text            =   "ASS_TREAD_LF"
         Top             =   2520
         Width           =   1455
      End
      Begin VB.TextBox txtASS_RADIO 
         Height          =   285
         Left            =   1680
         TabIndex        =   54
         Text            =   "ASS_RADIO"
         Top             =   2520
         Width           =   1815
      End
      Begin VB.TextBox txtASS_TYRE_MAKE 
         Height          =   285
         Left            =   7080
         TabIndex        =   65
         Text            =   "ASS_TYRE_MAKE"
         Top             =   2160
         Width           =   1575
      End
      Begin VB.TextBox txtASS_TREAD_RF 
         Height          =   285
         Left            =   4560
         TabIndex        =   60
         Text            =   "ASS_TREAD_RF"
         Top             =   2160
         Width           =   1455
      End
      Begin VB.TextBox txtASS_ALARM 
         Height          =   285
         Left            =   1680
         TabIndex        =   53
         Text            =   "ASS_ALARM"
         Top             =   2160
         Width           =   1815
      End
      Begin VB.TextBox txtASS_DAMAGE_WINDSCREEN 
         Height          =   285
         Left            =   4560
         TabIndex        =   48
         Text            =   "ASS_DAMAGE_WIND_SCREEN"
         Top             =   1680
         Width           =   1455
      End
      Begin VB.TextBox txtASS_VEHICLE_WINDOW_CODE 
         Height          =   285
         Left            =   1680
         TabIndex        =   43
         Text            =   "ASS_VEHICLE_WINDOW_CODE"
         Top             =   1680
         Width           =   1815
      End
      Begin VB.TextBox txtASS_DAMAGE_MISSING_PARTS 
         Height          =   645
         Left            =   7080
         MultiLine       =   -1  'True
         TabIndex        =   52
         Top             =   1320
         Width           =   1575
      End
      Begin VB.TextBox txtASS_DAMAGE_CHASSIS 
         Height          =   285
         Left            =   4560
         TabIndex        =   47
         Text            =   "ASS_DAMAGE_CHASSIS"
         Top             =   1320
         Width           =   1455
      End
      Begin VB.TextBox txtASS_VEHICLE_COLOUR 
         Height          =   285
         Left            =   1680
         TabIndex        =   42
         Text            =   "ASS_VEHICLE_COLOR"
         Top             =   1320
         Width           =   1815
      End
      Begin VB.TextBox txtASS_DAMAGE_HAND_BRAKE 
         Height          =   285
         Left            =   7080
         TabIndex        =   51
         Text            =   "ASS_DAMAGE_HAND_BRAKE"
         Top             =   960
         Width           =   1575
      End
      Begin VB.TextBox txtASS_DAMAGE_PAINT 
         Height          =   285
         Left            =   4560
         TabIndex        =   46
         Text            =   "ASS_DAMAGE_PAINT"
         Top             =   960
         Width           =   1455
      End
      Begin VB.TextBox txtASS_VEHICLE_KILOMETRES 
         Height          =   285
         Left            =   1680
         TabIndex        =   41
         Text            =   "ASS_VEHICLE_KILOMETRES"
         Top             =   960
         Width           =   1815
      End
      Begin VB.TextBox txtASS_DAMAGE_FOOT_BRAKE 
         Height          =   285
         Left            =   7080
         TabIndex        =   50
         Text            =   "ASS_DAMAGE_FOOTBRAKE"
         Top             =   600
         Width           =   1575
      End
      Begin VB.TextBox txtASS_DAMAGE_PANEL 
         Height          =   285
         Left            =   4560
         TabIndex        =   45
         Text            =   "ASS_DAMAGE_PANEL"
         Top             =   600
         Width           =   1455
      End
      Begin VB.TextBox txtASS_VEHICLE_ENGINE_NO 
         Height          =   285
         Left            =   1680
         TabIndex        =   40
         Text            =   "ASS_VEHICLE_ENGINE_NO"
         Top             =   600
         Width           =   1815
      End
      Begin VB.TextBox txtASS_DAMAGE_UPHOLSTRY 
         Height          =   285
         Left            =   7080
         TabIndex        =   49
         Text            =   "ASS_DAMAGE_UPHOLSTRY"
         Top             =   240
         Width           =   1575
      End
      Begin VB.TextBox txtASS_DAMAGE_MECHANICAL 
         Height          =   285
         Left            =   4560
         TabIndex        =   44
         Text            =   "ASS_DAMAGE_MECHANICAL"
         Top             =   240
         Width           =   1455
      End
      Begin VB.TextBox txtASS_VEHICLE_CHASSIS_NO 
         Height          =   285
         Left            =   1680
         TabIndex        =   39
         Text            =   "ASS_VEHICLE_CHASSIS_NO"
         Top             =   240
         Width           =   1815
      End
      Begin VB.TextBox txtASS_AMOUNT_QUOTED 
         Alignment       =   1  'Right Justify
         BeginProperty DataFormat 
            Type            =   1
            Format          =   """R"" #,##0.00"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   7177
            SubFormatType   =   2
         EndProperty
         Height          =   285
         Left            =   4560
         TabIndex        =   73
         Text            =   "ASS_AMOUNT_QUOTED"
         Top             =   4080
         Width           =   1455
      End
      Begin VB.TextBox txtASS_EXTRAS 
         Height          =   975
         Left            =   720
         MultiLine       =   -1  'True
         TabIndex        =   59
         Text            =   "frmAssessment.frx":57FC
         Top             =   3600
         Width           =   2415
      End
      Begin VB.Label lblASS_BOOK_IN_DATE 
         Alignment       =   1  'Right Justify
         Caption         =   "Book In"
         Height          =   255
         Left            =   6120
         TabIndex        =   229
         Top             =   6240
         Width           =   855
      End
      Begin VB.Line Line9 
         X1              =   120
         X2              =   3240
         Y1              =   4680
         Y2              =   4680
      End
      Begin VB.Line Line7 
         X1              =   3240
         X2              =   3240
         Y1              =   4680
         Y2              =   3960
      End
      Begin VB.Label lblASS_ADDITIONALS 
         Alignment       =   1  'Right Justify
         Caption         =   "Additionals"
         Height          =   255
         Left            =   3360
         TabIndex        =   208
         Top             =   5160
         Width           =   1095
      End
      Begin VB.Label lblASS_SAVINGS 
         Alignment       =   1  'Right Justify
         Caption         =   "Savings"
         Height          =   255
         Left            =   3360
         TabIndex        =   207
         Top             =   4800
         Width           =   1095
      End
      Begin VB.Line Line6 
         X1              =   5760
         X2              =   8640
         Y1              =   3960
         Y2              =   3960
      End
      Begin VB.Label lblASS_WORK_DAYS 
         Alignment       =   1  'Right Justify
         Caption         =   "Work Days"
         Height          =   255
         Left            =   5880
         TabIndex        =   190
         Top             =   5880
         Width           =   1095
      End
      Begin VB.Label lblASS_QUOTE_NO 
         Alignment       =   1  'Right Justify
         Caption         =   "Quote No"
         Height          =   255
         Left            =   5880
         TabIndex        =   189
         Top             =   5520
         Width           =   1095
      End
      Begin VB.Label lblASS_TOTAL 
         Alignment       =   1  'Right Justify
         Caption         =   "Total"
         Height          =   255
         Left            =   5880
         TabIndex        =   188
         Top             =   5160
         Width           =   1095
      End
      Begin VB.Label lblASS_EXCESS 
         Alignment       =   1  'Right Justify
         Caption         =   "Excess"
         Height          =   255
         Left            =   5880
         TabIndex        =   187
         Top             =   4800
         Width           =   1095
      End
      Begin VB.Label lblASS_SUB_TOTAL_2 
         Alignment       =   1  'Right Justify
         Caption         =   "Sub Total 2"
         Height          =   255
         Left            =   5880
         TabIndex        =   186
         Top             =   4440
         Width           =   1095
      End
      Begin VB.Label lblASS_VAT 
         Alignment       =   1  'Right Justify
         Caption         =   "V.A.T."
         Height          =   255
         Left            =   5880
         TabIndex        =   185
         Top             =   4080
         Width           =   1095
      End
      Begin VB.Label lblASS_SUB_TOTAL_1 
         Alignment       =   1  'Right Justify
         Caption         =   "Sub Total 1"
         Height          =   255
         Left            =   3360
         TabIndex        =   184
         Top             =   6240
         Width           =   1095
      End
      Begin VB.Label lblASS_BETTERMENT 
         Alignment       =   1  'Right Justify
         Caption         =   "Betterment"
         Height          =   255
         Left            =   3240
         TabIndex        =   183
         Top             =   5880
         Width           =   1215
      End
      Begin VB.Label lblASS_DISCOUNT 
         Alignment       =   1  'Right Justify
         Caption         =   "Discount %"
         Height          =   255
         Left            =   3240
         TabIndex        =   182
         Top             =   5520
         Width           =   1215
      End
      Begin VB.Label lblASS_AMOUNT_AGREED 
         Alignment       =   1  'Right Justify
         Caption         =   "Amount Agreed"
         Height          =   255
         Left            =   3240
         TabIndex        =   181
         Top             =   4440
         Width           =   1215
      End
      Begin VB.Label lblASS_AMOUNT_QUOTED 
         Alignment       =   1  'Right Justify
         Caption         =   "Amount Quoted"
         Height          =   255
         Left            =   3240
         TabIndex        =   180
         Top             =   4080
         Width           =   1215
      End
      Begin VB.Label lblASS_MARKET_VALUE 
         Alignment       =   1  'Right Justify
         Caption         =   "Market Value"
         Height          =   255
         Left            =   480
         TabIndex        =   179
         Top             =   6240
         Width           =   1215
      End
      Begin VB.Label lblASS_OLD_DAMAGE_NOTE 
         Alignment       =   1  'Right Justify
         Caption         =   "Old Damage"
         Height          =   255
         Left            =   480
         TabIndex        =   178
         Top             =   5520
         Width           =   1215
      End
      Begin VB.Label lblASS_KILOMETRE 
         Alignment       =   1  'Right Justify
         Caption         =   "Kilometre %"
         Height          =   255
         Left            =   480
         TabIndex        =   177
         Top             =   5880
         Width           =   1215
      End
      Begin VB.Label lblASS_RETAIL 
         Alignment       =   1  'Right Justify
         Caption         =   "Retail"
         Height          =   255
         Left            =   480
         TabIndex        =   176
         Top             =   5160
         Width           =   1215
      End
      Begin VB.Label lblASS_1 
         Alignment       =   1  'Right Justify
         Caption         =   "Trade In"
         Height          =   255
         Left            =   480
         TabIndex        =   175
         Top             =   4800
         Width           =   1215
      End
      Begin VB.Line Line4 
         X1              =   3240
         X2              =   5760
         Y1              =   3960
         Y2              =   3960
      End
      Begin VB.Label lblASS_TREAD_SPARE 
         Alignment       =   1  'Right Justify
         Caption         =   "Tread Spare"
         Height          =   255
         Left            =   3240
         TabIndex        =   152
         Top             =   3600
         Width           =   1215
      End
      Begin VB.Label lblASS_TREAD_RR 
         Alignment       =   1  'Right Justify
         Caption         =   "Tread R/R"
         Height          =   255
         Left            =   3240
         TabIndex        =   151
         Top             =   3240
         Width           =   1215
      End
      Begin VB.Label lblASS_TREAD_LR 
         Alignment       =   1  'Right Justify
         Caption         =   "Tread L/R"
         Height          =   255
         Left            =   3240
         TabIndex        =   150
         Top             =   2880
         Width           =   1215
      End
      Begin VB.Label lblASS_TYRE_SIZE 
         Alignment       =   1  'Right Justify
         Caption         =   "Tyre Size"
         Height          =   255
         Left            =   5880
         TabIndex        =   148
         Top             =   2520
         Width           =   1095
      End
      Begin VB.Label lblASS_TREAD_LF 
         Alignment       =   1  'Right Justify
         Caption         =   "Tread L/F"
         Height          =   255
         Left            =   3240
         TabIndex        =   147
         Top             =   2520
         Width           =   1215
      End
      Begin VB.Label lblASS_RADIO 
         Alignment       =   1  'Right Justify
         Caption         =   "Radio"
         Height          =   255
         Left            =   720
         TabIndex        =   146
         Top             =   2520
         Width           =   855
      End
      Begin VB.Label lblASS_TYRE_MAKE 
         Alignment       =   1  'Right Justify
         Caption         =   "Tyre Make"
         Height          =   255
         Left            =   5880
         TabIndex        =   145
         Top             =   2160
         Width           =   1095
      End
      Begin VB.Label lblASS_TREAD_RF 
         Alignment       =   1  'Right Justify
         Caption         =   "Tread R/F"
         Height          =   255
         Left            =   3240
         TabIndex        =   144
         Top             =   2160
         Width           =   1215
      End
      Begin VB.Label lblASS_ALARM 
         Alignment       =   1  'Right Justify
         Caption         =   "Alarm System"
         Height          =   255
         Left            =   600
         TabIndex        =   143
         Top             =   2160
         Width           =   975
      End
      Begin VB.Line Line5 
         X1              =   120
         X2              =   8640
         Y1              =   2040
         Y2              =   2040
      End
      Begin VB.Label lblASS_DAMAGE_WINDSCREEN 
         Alignment       =   1  'Right Justify
         Caption         =   "Windscreen"
         Height          =   255
         Left            =   3240
         TabIndex        =   142
         Top             =   1680
         Width           =   1215
      End
      Begin VB.Label lblASS_VEHICLE_WINDOW_CODE 
         Alignment       =   1  'Right Justify
         Caption         =   "Window Code"
         Height          =   255
         Left            =   360
         TabIndex        =   141
         Top             =   1680
         Width           =   1215
      End
      Begin VB.Label lblASS_DAMAGE_MISSING_PARTS 
         Alignment       =   1  'Right Justify
         Caption         =   "Missing Parts"
         Height          =   255
         Left            =   5880
         TabIndex        =   140
         Top             =   1320
         Width           =   1095
      End
      Begin VB.Label lblASS_DAMAGE_CHASSIS 
         Alignment       =   1  'Right Justify
         Caption         =   "Chassis"
         Height          =   255
         Left            =   3240
         TabIndex        =   139
         Top             =   1320
         Width           =   1215
      End
      Begin VB.Label lblASS_COLOUR 
         Alignment       =   1  'Right Justify
         Caption         =   "Colour"
         Height          =   255
         Left            =   360
         TabIndex        =   138
         Top             =   1320
         Width           =   1215
      End
      Begin VB.Label lblASS_DAMAGE_HAND_BRAKE 
         Alignment       =   1  'Right Justify
         Caption         =   "Hand Brake"
         Height          =   255
         Left            =   5880
         TabIndex        =   137
         Top             =   960
         Width           =   1095
      End
      Begin VB.Label lblASS_DAMAGE_PAINT 
         Alignment       =   1  'Right Justify
         Caption         =   "Paint"
         Height          =   255
         Left            =   3240
         TabIndex        =   136
         Top             =   960
         Width           =   1215
      End
      Begin VB.Label lblASS_KILOMETRES 
         Alignment       =   1  'Right Justify
         Caption         =   "Kilometres"
         Height          =   255
         Left            =   360
         TabIndex        =   135
         Top             =   960
         Width           =   1215
      End
      Begin VB.Label lblASS_DAMAGE_FOOTBRAKE 
         Alignment       =   1  'Right Justify
         Caption         =   "Foot Brake"
         Height          =   255
         Left            =   5880
         TabIndex        =   134
         Top             =   600
         Width           =   1095
      End
      Begin VB.Label lblASS_DAMAGE_PANEL 
         Alignment       =   1  'Right Justify
         Caption         =   "Panel"
         Height          =   255
         Left            =   3240
         TabIndex        =   133
         Top             =   600
         Width           =   1215
      End
      Begin VB.Label lblASS_ENGINE_NO 
         Alignment       =   1  'Right Justify
         Caption         =   "Engine No"
         Height          =   255
         Left            =   360
         TabIndex        =   132
         Top             =   600
         Width           =   1215
      End
      Begin VB.Label lblASS_DAMAGE_UPHOLSTRY 
         Alignment       =   1  'Right Justify
         Caption         =   "Upholstry"
         Height          =   255
         Left            =   5880
         TabIndex        =   131
         Top             =   240
         Width           =   1095
      End
      Begin VB.Label lblASS_DAMAGE_MECHANICAL 
         Alignment       =   1  'Right Justify
         Caption         =   "Mechanical"
         Height          =   255
         Left            =   3240
         TabIndex        =   130
         Top             =   240
         Width           =   1215
      End
      Begin VB.Label lblASS_VEHICLE_CHASSIS_NO 
         Alignment       =   1  'Right Justify
         Caption         =   "Chassis No"
         Height          =   255
         Left            =   360
         TabIndex        =   129
         Top             =   240
         Width           =   1215
      End
      Begin VB.Label lblASS_EXTRAS 
         Alignment       =   1  'Right Justify
         Caption         =   "Extras"
         Height          =   255
         Left            =   120
         TabIndex        =   149
         Top             =   2880
         Width           =   495
      End
   End
   Begin VB.ComboBox cmbSEARCH 
      Height          =   315
      Left            =   120
      TabIndex        =   233
      Text            =   "Combo1"
      Top             =   6240
      Width           =   2415
   End
   Begin VB.Frame frmReminders 
      Height          =   6855
      Left            =   2760
      TabIndex        =   224
      Top             =   360
      Width           =   9015
      Begin VB.ListBox lstReminders 
         Height          =   6495
         ItemData        =   "frmAssessment.frx":580A
         Left            =   120
         List            =   "frmAssessment.frx":580C
         TabIndex        =   225
         Top             =   240
         Width           =   8775
      End
   End
   Begin VB.Frame frmPhotos3 
      Height          =   6855
      Left            =   2760
      TabIndex        =   211
      Top             =   360
      Width           =   9015
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   11
         Left            =   4440
         Stretch         =   -1  'True
         Top             =   3120
         Width           =   4095
      End
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   9
         Left            =   4440
         Stretch         =   -1  'True
         Top             =   240
         Width           =   4095
      End
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   10
         Left            =   240
         Stretch         =   -1  'True
         Top             =   3120
         Width           =   4095
      End
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   8
         Left            =   240
         Stretch         =   -1  'True
         Top             =   240
         Width           =   4095
      End
   End
   Begin VB.Frame frmPhotos2 
      Height          =   6855
      Left            =   2760
      TabIndex        =   191
      Top             =   360
      Width           =   9015
      Begin VB.TextBox txtASS_DAMAGE_PICTURE 
         Height          =   285
         Left            =   360
         TabIndex        =   192
         Text            =   "ASS_DAMAGE_PICTURE"
         Top             =   4800
         Visible         =   0   'False
         Width           =   3855
      End
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   6
         Left            =   240
         Stretch         =   -1  'True
         Top             =   3120
         Width           =   4095
      End
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   7
         Left            =   4440
         Stretch         =   -1  'True
         Top             =   3120
         Width           =   4095
      End
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   5
         Left            =   4440
         Stretch         =   -1  'True
         Top             =   240
         Width           =   4095
      End
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   4
         Left            =   240
         Stretch         =   -1  'True
         Top             =   240
         Width           =   4095
      End
   End
   Begin VB.Frame frmPhotos 
      Height          =   6855
      Left            =   2760
      TabIndex        =   153
      Top             =   360
      Width           =   9015
      Begin MSComDlg.CommonDialog cd1 
         Left            =   8040
         Top             =   6000
         _ExtentX        =   847
         _ExtentY        =   847
         _Version        =   393216
         CancelError     =   -1  'True
         DialogTitle     =   "Select Photo"
         Filter          =   "JPEG photo|*.jpg|BMP picture|*.bmp|GIF image|*.gif"
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   11
         Left            =   4560
         TabIndex        =   223
         TabStop         =   0   'False
         Top             =   4320
         Width           =   1695
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   10
         Left            =   4560
         TabIndex        =   222
         TabStop         =   0   'False
         Top             =   3960
         Width           =   1695
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   9
         Left            =   4560
         TabIndex        =   221
         TabStop         =   0   'False
         Top             =   3600
         Width           =   1695
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   8
         Left            =   4560
         TabIndex        =   220
         TabStop         =   0   'False
         Top             =   3240
         Width           =   1695
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   7
         Left            =   360
         TabIndex        =   219
         TabStop         =   0   'False
         Top             =   4320
         Width           =   1695
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   6
         Left            =   360
         TabIndex        =   218
         TabStop         =   0   'False
         Top             =   3960
         Width           =   1695
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   5
         Left            =   360
         TabIndex        =   217
         TabStop         =   0   'False
         Top             =   3600
         Width           =   1695
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   4
         Left            =   360
         TabIndex        =   216
         TabStop         =   0   'False
         Top             =   3240
         Width           =   1695
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   3
         Left            =   360
         TabIndex        =   215
         TabStop         =   0   'False
         Top             =   1440
         Width           =   1695
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   2
         Left            =   360
         TabIndex        =   214
         TabStop         =   0   'False
         Top             =   1080
         Width           =   1695
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   1
         Left            =   360
         TabIndex        =   213
         TabStop         =   0   'False
         Top             =   720
         Width           =   1695
      End
      Begin VB.TextBox txtASS_PHOTO 
         Height          =   285
         Index           =   0
         Left            =   360
         TabIndex        =   212
         TabStop         =   0   'False
         Top             =   360
         Width           =   1695
      End
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   0
         Left            =   240
         Stretch         =   -1  'True
         Top             =   240
         Width           =   4095
      End
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   2
         Left            =   240
         Stretch         =   -1  'True
         Top             =   3120
         Width           =   4095
      End
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   3
         Left            =   4440
         Stretch         =   -1  'True
         Top             =   3120
         Width           =   4095
      End
      Begin VB.Image picASS_PHOTO 
         Appearance      =   0  'Flat
         BorderStyle     =   1  'Fixed Single
         Height          =   2775
         Index           =   1
         Left            =   4440
         Stretch         =   -1  'True
         Top             =   240
         Width           =   4095
      End
   End
   Begin VB.Frame frmNotes 
      Height          =   6855
      Left            =   2760
      TabIndex        =   166
      Top             =   360
      Width           =   9015
      Begin MSACAL.Calendar calASS_DATE_UPLIFTED 
         Height          =   2175
         Left            =   1320
         TabIndex        =   200
         TabStop         =   0   'False
         Top             =   2040
         Width           =   2295
         _Version        =   524288
         _ExtentX        =   4048
         _ExtentY        =   3836
         _StockProps     =   1
         BackColor       =   -2147483633
         Year            =   2005
         Month           =   3
         Day             =   4
         DayLength       =   0
         MonthLength     =   0
         DayFontColor    =   0
         FirstDay        =   1
         GridCellEffect  =   1
         GridFontColor   =   10485760
         GridLinesColor  =   -2147483632
         ShowDateSelectors=   -1  'True
         ShowDays        =   -1  'True
         ShowHorizontalGrid=   -1  'True
         ShowTitle       =   0   'False
         ShowVerticalGrid=   -1  'True
         TitleFontColor  =   10485760
         ValueIsNull     =   0   'False
         BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
      End
      Begin VB.CommandButton cmdBlankDate 
         Caption         =   "X"
         Height          =   255
         Left            =   2640
         TabIndex        =   226
         TabStop         =   0   'False
         Top             =   2040
         Width           =   255
      End
      Begin VB.CommandButton cmdClear 
         Caption         =   "&Clear Image"
         Height          =   1215
         Left            =   7440
         TabIndex        =   96
         Top             =   3840
         Width           =   1215
      End
      Begin VB.CommandButton cmdAddReminder 
         Caption         =   "Add Reminder"
         Height          =   1215
         Left            =   7440
         TabIndex        =   98
         Top             =   5280
         Width           =   1215
      End
      Begin VB.TextBox txtASS_DATE_UPLIFTED 
         Height          =   285
         Left            =   1320
         TabIndex        =   94
         Text            =   "ASS_DATE_UPLIFTED"
         Top             =   2040
         Width           =   1215
      End
      Begin VB.PictureBox picASS_DAMAGE_PICTURE 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         BackColor       =   &H80000005&
         FillColor       =   &H80000005&
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   18
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   3495
         Left            =   3000
         ScaleHeight     =   3465
         ScaleWidth      =   5625
         TabIndex        =   167
         Top             =   240
         Width           =   5655
      End
      Begin VB.TextBox txtASS_NOTE 
         Height          =   1215
         Left            =   1080
         MultiLine       =   -1  'True
         TabIndex        =   88
         Text            =   "frmAssessment.frx":580E
         Top             =   5280
         Width           =   6255
      End
      Begin VB.TextBox txtASS_OLD_DAMAGE_NOTE 
         Height          =   1215
         Left            =   1080
         MultiLine       =   -1  'True
         TabIndex        =   97
         Text            =   "frmAssessment.frx":5817
         Top             =   3840
         Width           =   4335
      End
      Begin VB.TextBox txtAsS_WRECK_LOCATION 
         Height          =   285
         Left            =   1320
         TabIndex        =   89
         Text            =   "ASS_WRECK_ALOCATION"
         Top             =   240
         Width           =   1575
      End
      Begin VB.TextBox txtASS_WRECK_SALVAGE_DEALER 
         Height          =   285
         Left            =   1320
         TabIndex        =   90
         Text            =   "ASS_WRECK_SALVAGE_DEALER"
         Top             =   600
         Width           =   1575
      End
      Begin VB.TextBox txtASS_WRECK_TEL 
         Height          =   285
         Left            =   1320
         TabIndex        =   91
         Text            =   "ASS_WRECK_TEL"
         Top             =   960
         Width           =   1575
      End
      Begin VB.TextBox txtASS_WRECK_CONTACT 
         Height          =   285
         Left            =   1320
         TabIndex        =   92
         Text            =   "ASS_WRECK_CONTACT"
         Top             =   1320
         Width           =   1575
      End
      Begin VB.TextBox txtASS_WRECK_STOCK_NO 
         Height          =   285
         Left            =   1320
         TabIndex        =   93
         Text            =   "ASS_WRECK_STOCK_N)"
         Top             =   1680
         Width           =   1575
      End
      Begin VB.ListBox lstDamage 
         Height          =   1230
         Left            =   5520
         TabIndex        =   95
         Top             =   3840
         Width           =   1815
      End
      Begin VB.Label lblASS_OLD_DAMAGE 
         Alignment       =   1  'Right Justify
         BackStyle       =   0  'Transparent
         Caption         =   "Old Damage"
         Height          =   255
         Left            =   0
         TabIndex        =   231
         Top             =   4080
         Width           =   975
      End
      Begin VB.Label lblASS_DATE_UPLIFTED 
         Alignment       =   1  'Right Justify
         Caption         =   "Date Uplifted"
         Height          =   255
         Left            =   120
         TabIndex        =   199
         Top             =   2040
         Width           =   1095
      End
      Begin VB.Label lblASS_NOTES 
         Alignment       =   1  'Right Justify
         Caption         =   "Notes"
         Height          =   255
         Left            =   120
         TabIndex        =   173
         Top             =   5280
         Width           =   855
      End
      Begin VB.Label lblASS_WRECK_LOCATION 
         Caption         =   "Wreck Location"
         Height          =   255
         Left            =   120
         TabIndex        =   172
         Top             =   240
         Width           =   1335
      End
      Begin VB.Label lblASS_WRECK_SALVAGE_DEALER 
         Caption         =   "Salvage Dealer"
         Height          =   255
         Left            =   120
         TabIndex        =   171
         Top             =   600
         Width           =   1095
      End
      Begin VB.Label lblASS_WRECK_TEL 
         Alignment       =   1  'Right Justify
         Caption         =   "Tel"
         Height          =   255
         Left            =   120
         TabIndex        =   170
         Top             =   960
         Width           =   1095
      End
      Begin VB.Label lblASS_WRECK_CONTACT 
         Alignment       =   1  'Right Justify
         Caption         =   "Contact"
         Height          =   255
         Left            =   120
         TabIndex        =   169
         Top             =   1320
         Width           =   1095
      End
      Begin VB.Label lblASS_WRECK_STOCK_NO 
         Alignment       =   1  'Right Justify
         Caption         =   "Stock No"
         Height          =   255
         Left            =   120
         TabIndex        =   168
         Top             =   1680
         Width           =   1095
      End
   End
   Begin PicFormat32a.PicFormat32 PicFormat321 
      Height          =   255
      Left            =   240
      TabIndex        =   230
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
      _ExtentX        =   450
      _ExtentY        =   450
   End
   Begin MSACAL.Calendar Calendar1 
      Height          =   2295
      Left            =   120
      TabIndex        =   109
      TabStop         =   0   'False
      Top             =   0
      Width           =   2415
      _Version        =   524288
      _ExtentX        =   4260
      _ExtentY        =   4048
      _StockProps     =   1
      BackColor       =   -2147483633
      Year            =   2004
      Month           =   8
      Day             =   18
      DayLength       =   3
      MonthLength     =   1
      DayFontColor    =   0
      FirstDay        =   1
      GridCellEffect  =   1
      GridFontColor   =   10485760
      GridLinesColor  =   -2147483632
      ShowDateSelectors=   -1  'True
      ShowDays        =   -1  'True
      ShowHorizontalGrid=   0   'False
      ShowTitle       =   0   'False
      ShowVerticalGrid=   0   'False
      TitleFontColor  =   10485760
      ValueIsNull     =   0   'False
      BeginProperty DayFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty GridFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty TitleFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin MSMAPI.MAPIMessages mvarMAPIMessages 
      Left            =   240
      Top             =   4200
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      AddressEditFieldCount=   1
      AddressModifiable=   0   'False
      AddressResolveUI=   0   'False
      FetchSorted     =   0   'False
      FetchUnreadOnly =   0   'False
   End
   Begin MSMAPI.MAPISession mvarMAPISession 
      Left            =   240
      Top             =   4920
      _ExtentX        =   1005
      _ExtentY        =   1005
      _Version        =   393216
      DownloadMail    =   0   'False
      LogonUI         =   -1  'True
      NewSession      =   0   'False
   End
   Begin VB.ComboBox cmbFILTER 
      Height          =   315
      Left            =   120
      Style           =   2  'Dropdown List
      TabIndex        =   210
      TabStop         =   0   'False
      Top             =   360
      Width           =   2415
   End
   Begin VB.TextBox txtSEARCH 
      Height          =   315
      Left            =   120
      TabIndex        =   205
      TabStop         =   0   'False
      Text            =   "txtSEARCH"
      Top             =   6600
      Width           =   2415
   End
   Begin VB.CommandButton cmdSEARCH 
      Caption         =   "&Do Search"
      Height          =   375
      Left            =   120
      TabIndex        =   204
      TabStop         =   0   'False
      Top             =   6960
      Width           =   2415
   End
   Begin MSComDlg.CommonDialog CD2 
      Left            =   240
      Top             =   3600
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      CancelError     =   -1  'True
      DialogTitle     =   "Save To PDF"
      Filter          =   "PDF File | *.pdf"
   End
   Begin VB.TextBox txtDate 
      Height          =   285
      Left            =   120
      TabIndex        =   174
      TabStop         =   0   'False
      Text            =   "DATE"
      Top             =   0
      Width           =   2415
   End
   Begin VB.ListBox lstAssessments 
      Height          =   5130
      Left            =   120
      TabIndex        =   108
      TabStop         =   0   'False
      Top             =   720
      Width           =   2415
   End
   Begin MSComctlLib.TabStrip tabMain 
      Height          =   7335
      Left            =   2640
      TabIndex        =   1
      TabStop         =   0   'False
      Top             =   0
      Width           =   9255
      _ExtentX        =   16325
      _ExtentY        =   12938
      MultiRow        =   -1  'True
      ShowTips        =   0   'False
      TabFixedWidth   =   1968
      TabMinWidth     =   998
      _Version        =   393216
      BeginProperty Tabs {1EFB6598-857C-11D1-B16A-00C0F0283628} 
         NumTabs         =   8
         BeginProperty Tab1 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Assessment"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab2 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Vehicle"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab3 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Notes"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab4 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Costing"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab5 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Photos 1"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab6 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Photos 2"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab7 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Photos 3"
            ImageVarType    =   2
         EndProperty
         BeginProperty Tab8 {1EFB659A-857C-11D1-B16A-00C0F0283628} 
            Caption         =   "Reminders"
            ImageVarType    =   2
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label lblSeacrh 
      Caption         =   "Search Criteria"
      Height          =   255
      Left            =   120
      TabIndex        =   232
      Top             =   6000
      Width           =   1095
   End
   Begin VB.Menu mnuRoot 
      Caption         =   "&Assessment"
      Index           =   0
      Begin VB.Menu mnuAssessment 
         Caption         =   "&New"
         Index           =   0
      End
      Begin VB.Menu mnuAssessment 
         Caption         =   "&Load"
         Index           =   1
      End
      Begin VB.Menu mnuAssessment 
         Caption         =   "&Delete"
         Index           =   2
      End
      Begin VB.Menu mnuAssessment 
         Caption         =   "&Re-Assess"
         Index           =   3
      End
      Begin VB.Menu mnuAssessment 
         Caption         =   "&Save"
         Index           =   4
      End
      Begin VB.Menu mnuAssessment 
         Caption         =   "-"
         Index           =   5
      End
      Begin VB.Menu mnuAssessment 
         Caption         =   "&Generate PDF"
         Index           =   6
      End
      Begin VB.Menu mnuAssessment 
         Caption         =   "&Authorisation Letter"
         Index           =   7
      End
      Begin VB.Menu mnuAssessment 
         Caption         =   "&Flags"
         Index           =   8
      End
      Begin VB.Menu mnuAssessment 
         Caption         =   "-"
         Index           =   9
      End
      Begin VB.Menu mnuAssessment 
         Caption         =   "Generate &Blank"
         Index           =   10
      End
   End
   Begin VB.Menu mnuRoot 
      Caption         =   "&Tools"
      Index           =   1
      Begin VB.Menu mnuTools 
         Caption         =   "&Monthly Reports"
         Index           =   0
      End
      Begin VB.Menu mnuTools 
         Caption         =   "&Reminders"
         Index           =   1
      End
      Begin VB.Menu mnuTools 
         Caption         =   "-"
         Index           =   2
      End
      Begin VB.Menu mnuTools 
         Caption         =   "&Insurance"
         Index           =   3
      End
      Begin VB.Menu mnuTools 
         Caption         =   "&Branch"
         Index           =   4
      End
      Begin VB.Menu mnuTools 
         Caption         =   "&Clark"
         Index           =   5
      End
      Begin VB.Menu mnuTools 
         Caption         =   "&Assessor"
         Index           =   6
      End
      Begin VB.Menu mnuTools 
         Caption         =   "C&ompany Details"
         Index           =   7
      End
      Begin VB.Menu mnuTools 
         Caption         =   "&Options"
         Index           =   8
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'==================================================================================
'Copyright (c) 2003, Andrew Jeremy Gargan (ajg@osite.co.za), Terence Leslie Van Zyl (tvz@osite.co.za)
'
'All rights reserved.
'
'Redistribution and use in source and binary forms, with or without modification,
'are permitted provided that the following conditions are met:
'
'Redistributions of source code must retain the above copyright notice, this list
'of conditions and the following disclaimer.
'
'Redistributions in binary form must reproduce the above copyright notice, this
'list of conditions and the following disclaimer in the documentation and/or other
'materials provided with the distribution.
'
'Neither the name of the <ORGANIZATION> nor the names of its contributors may be
'used to endorse or promote products derived from this software without specific
'prior written permission.
'
'THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
'ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
'WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
'IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
'INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
'BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
'DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
'LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
'OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
'OF THE POSSIBILITY OF SUCH DAMAGE.
'===================================================================================
Private repControl As New Reportman.ReportManX

Public mvarASS_KEY As Integer
Public mvarRE_ASSESSMENT As Boolean

Private mvarLIST_CLICK As Boolean

Private Sub load_assessment()
    'set assessment key
    mvarASS_KEY = lstAssessments.ItemData(lstAssessments.ListIndex)
    'set the first tab if we are still on reminders
    If tabMain.SelectedItem.index = 8 Then
        tabMain.Tabs.Item(1).Selected = True
    End If
    'populate form
    Fill_Form
    'Enable Form
    able_form True
    'Comba Action Lists
    build_lists
End Sub

Private Sub set_header()
    Dim lvarRS As DAO.Recordset
    Dim lvarQuery As String
    
    lvarQuery = "SELECT * FROM USER WHERE USR_KEY=1"
    
    Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenSnapshot)
    
    'lblCompany.Caption = IIf(IsNull(lvarRS("USR_COMPANY")), "", lvarRS("USR_COMPANY"))
    'lblCellNo.Caption = "Cell: " & IIf(IsNull(lvarRS("USR_CELL")), "", lvarRS("USR_CELL"))
    'lblFax.Caption = "Fax: " & lvarRS("USR_FAX")
    'lblEmail.Caption = "Email: " & lvarRS("USR_EMAIL")
    'lblVAT_NO.Caption = "VAT No: " & IIf(IsNull(lvarRS("USR_VAT_NO")), "", lvarRS("USR_VAT_NO"))
    'lblTelephone.Caption = "Tel: " & IIf(IsNull(lvarRS("USR_TELEPHONE")), "", lvarRS("USR_TELEPHONE"))
    'lblRegistration.Caption = IIf(IsNull(lvarRS("USR_REGISTRATION")), "", lvarRS("USR_REGISTRATION"))
End Sub

Private Sub list_assessments()
    Dim lvarRS As DAO.Recordset
    Dim lvarQuery As String
    Dim lvarDate As String
    Dim lvarCounter As Long
    Dim lvarPosition As Long
    
    lstAssessments.Clear
    
    Select Case cmbFILTER.List(cmbFILTER.ListIndex)
        'Case "Current Month(P&U)"
        '    'change to be current month only
        '    lvarDate = "01-" & Left(VBA.MonthName(VBA.Month(VBA.Date)), 3) & "-" & VBA.Year(VBA.Date)
        '    lvarQuery = "SELECT ASS_RE_ASSESSMENT,ASS_INVOICE_NO, ASS_DATE_ASSESSED, ASS_KEY " & _
        '                "FROM ASSESSMENT " & _
        '                "WHERE ASS_DATE_ASSESSED >= #" & lvarDate & "# " & _
        '                "ORDER BY ASS_INVOICE_NO, ASS_DATE_ASSESSED"
        'Case "Current Month(P)"
        '    'change to be current month only
        '    lvarDate = "01-" & Left(VBA.MonthName(VBA.Month(VBA.Date)), 3) & "-" & VBA.Year(VBA.Date)
        '    lvarQuery = "SELECT ASS_RE_ASSESSMENT,ASS_INVOICE_NO, ASS_DATE_ASSESSED, ASS_KEY " & _
        '                "FROM ASSESSMENT " & _
        '                "WHERE ASS_DATE_ASSESSED >= #" & lvarDate & "# " & _
        '                "AND ASS_PAID = true " & _
        '                "ORDER BY ASS_INVOICE_NO, ASS_DATE_ASSESSED"
        'Case "Current Month(U)"
        '    'change to be current month only
        '    lvarDate = "01-" & Left(VBA.MonthName(VBA.Month(VBA.Date)), 3) & "-" & VBA.Year(VBA.Date)
        '    lvarQuery = "SELECT ASS_RE_ASSESSMENT,ASS_INVOICE_NO, ASS_DATE_ASSESSED, ASS_KEY " & _
        '                "FROM ASSESSMENT " & _
        '                "WHERE ASS_DATE_ASSESSED >= #" & lvarDate & "# " & _
        '                "AND ASS_PAID = false " & _
        '                "ORDER BY ASS_INVOICE_NO, ASS_DATE_ASSESSED"
        Case "From Date (P&U)"
            lvarDate = txtDate
            lvarQuery = "SELECT ASS_RE_ASSESSMENT,ASS_INVOICE_NO, ASS_DATE_ASSESSED, ASS_KEY " & _
                        "FROM ASSESSMENT " & _
                        "WHERE ASS_DATE_ASSESSED >= #" & lvarDate & "# " & _
                        "ORDER BY ASS_INVOICE_NO, ASS_DATE_ASSESSED"
        Case "From Date (P)"
            lvarDate = txtDate
            lvarQuery = "SELECT ASS_RE_ASSESSMENT,ASS_INVOICE_NO, ASS_DATE_ASSESSED, ASS_KEY " & _
                        "FROM ASSESSMENT " & _
                        "WHERE ASS_DATE_ASSESSED >= #" & lvarDate & "# " & _
                        "AND ASS_PAID = true " & _
                        "ORDER BY ASS_INVOICE_NO, ASS_DATE_ASSESSED"
        Case "From Date (U)"
            lvarDate = txtDate
            lvarQuery = "SELECT ASS_RE_ASSESSMENT,ASS_INVOICE_NO, ASS_DATE_ASSESSED, ASS_KEY " & _
                        "FROM ASSESSMENT " & _
                        "WHERE ASS_DATE_ASSESSED >= #" & lvarDate & "# " & _
                        "AND ASS_PAID = false " & _
                        "ORDER BY ASS_INVOICE_NO, ASS_DATE_ASSESSED"
        Case Else
            Exit Sub
    End Select
    
    Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenSnapshot)
    
    If lvarRS.EOF Then
        'Do nothing Nothing to list
        lstAssessments.Enabled = False
    Else
        lvarPosition = -1
        Do While Not lvarRS.EOF
            lstAssessments.AddItem IIf(lvarRS("ASS_RE_ASSESSMENT") = False, "", "RE-") & lvarRS("ASS_INVOICE_NO") & " - (" & lvarRS("ASS_DATE_ASSESSED") & " )"
            lstAssessments.ItemData(lstAssessments.NewIndex) = lvarRS("ASS_KEY")
            If (lstAssessments.ItemData(lstAssessments.NewIndex) = Val(mvarASS_KEY)) Then
                lvarPosition = lstAssessments.NewIndex
            End If
            lvarRS.MoveNext
        Loop
        
        lstAssessments.Enabled = True
        
        If lvarPosition > -1 Then
            'Set To the matching One
            lstAssessments.ListIndex = lvarPosition
        Else
            'No Match Latest in list
            If lstAssessments.ListCount > 0 Then
                lstAssessments.ListIndex = lstAssessments.ListCount - 1
            End If
        End If
    End If
    Exit Sub
errorhandler:
    'do diddly squat
    On Error GoTo 0
End Sub

'Private Sub calASS_DATE_OF_LOSS_Click()
'    txtASS_DATE_OF_LOSS = calASS_DATE_OF_LOSS.Value
'    calASS_DATE_OF_LOSS.Visible = False
'End Sub

'Private Sub calASS_DATE_OF_LOSS_DblClick()
'    txtASS_DATE_OF_LOSS = calASS_DATE_OF_LOSS.Value
'    calASS_DATE_OF_LOSS.Visible = False
'End Sub

'Private Sub calASS_DATE_OF_LOSS_LostFocus()
'    calASS_DATE_OF_LOSS.Visible = False
'End Sub

Private Sub calASS_PAID_DATE_Click()
    txtASS_PAID_DATE = calASS_PAID_DATE.Value
    calASS_PAID_DATE.Visible = False
End Sub

Private Sub calASS_PAID_DATE_DblClick()
    txtASS_PAID_DATE = calASS_PAID_DATE.Value
    calASS_PAID_DATE.Visible = False
End Sub

Private Sub calASS_PAID_DATE_LostFocus()
    calASS_PAID_DATE.Visible = False
End Sub

Private Sub calASS_DATE_AUTHORISED_Click()
    txtASS_DATE_AUTHORISED = calASS_DATE_AUTHORISED.Value
    calASS_DATE_AUTHORISED.Visible = False
End Sub

Private Sub calASS_DATE_AUTHORISED_DblClick()
    txtASS_DATE_AUTHORISED = calASS_DATE_AUTHORISED.Value
    calASS_PAID_DATE.Visible = False
    txtASS_DESCRIPTION_OF_LOSS.SetFocus
End Sub

Private Sub calASS_DATE_AUTHORISED_LostFocus()
    calASS_DATE_AUTHORISED.Visible = False
End Sub

Private Sub calASS_DATE_UPLIFTED_DblClick()
    txtASS_DATE_UPLIFTED = calASS_DATE_UPLIFTED.Value
    calASS_DATE_UPLIFTED.Visible = False
End Sub

Private Sub calASS_DATE_UPLIFTED_LostFocus()
    calASS_DATE_UPLIFTED.Visible = False
End Sub

Private Sub Calendar1_DblClick()
    txtDate = Calendar1.Value
    Calendar1.Visible = False
End Sub

Private Sub Calendar1_LostFocus()
    txtDate = Calendar1.Value
    Calendar1.Visible = False
End Sub

Private Sub Calendar2_DblClick()
    txtASS_DATE_ASSESSED.SetFocus
End Sub

Private Sub Calendar2_LostFocus()
    txtASS_DATE_INSTRUCTED = Calendar2.Value
    Calendar2.Visible = False
End Sub

Private Sub Calendar3_DblClick()
    txtASS_INVOICE_NO.SetFocus
End Sub

Private Sub Calendar3_LostFocus()
    txtASS_DATE_ASSESSED = Calendar3.Value
    Calendar3.Visible = False
End Sub

Private Sub chkASS_AUTHORISE_Click()
    If chkASS_AUTHORISED = 1 Then
        txtASS_DATE_AUTHORISED = calASS_DATE_AUTHORISED.Value
    Else
        If txtASS_DATE_AUTHORISED <> "" Then
            calASS_DATE_AUTHORISED.Value = txtASS_DATE_AUTHORISED
        End If
        txtASS_DATE_AUTHORISED = ""
    End If
End Sub

Private Sub chkASS_AUTHORISED_Click()
    If chkASS_AUTHORISED = CheckBoxConstants.vbChecked Then
        txtASS_DATE_AUTHORISED.Enabled = True
        If txtASS_DATE_AUTHORISED = "" Then
             txtASS_DATE_AUTHORISED.SetFocus
        End If
    Else
        txtASS_DATE_AUTHORISED.Enabled = False
        
    End If
End Sub

Private Sub chkASS_PAID_Click()
    If chkASS_PAID = CheckBoxConstants.vbChecked Then
        txtASS_PAID_DATE.Enabled = True
        If txtASS_PAID_DATE = "" And txtASS_PAID_DATE.Visible Then
             txtASS_PAID_DATE.SetFocus
        End If
    Else
        txtASS_PAID_DATE.Enabled = False
        
    End If
End Sub



Private Sub cmbFILTER_click()
    If cmbFILTER.ListCount > 0 Then
        list_assessments
        build_go
    End If
End Sub

Private Sub cmbFOR_INS_INSURANCE_click()
    Dim lvarRS As DAO.Recordset
    Dim lvarQuery As String
    
    lvarQuery = "SELECT * FROM INSURANCE WHERE INS_KEY=" & cmbFOR_INS_INSURANCE.ItemData(cmbFOR_INS_INSURANCE.ListIndex)
    Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenForwardOnly)
    
    txtFOR_INS_VAT_NO = IIf(IsNull(lvarRS("INS_VAT_NO")), "", lvarRS("INS_VAT_NO"))
End Sub

Private Sub cmbFOR_CLR_CLARK_click()

    Dim lvarRS As DAO.Recordset
    Dim lvarQuery As String
    
    lvarQuery = "SELECT * FROM CLARK WHERE CLR_KEY=" & cmbFOR_CLR_CLARK.ItemData(cmbFOR_CLR_CLARK.ListIndex)
    Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenForwardOnly)
    
    txtFOR_CLR_TEL = IIf(IsNull(lvarRS("CLR_TEL")), "", lvarRS("CLR_TEL"))
End Sub

Private Sub cmbFOR_BRA_BRANCH_click()
    Dim lvarRS As DAO.Recordset
    Dim lvarQuery As String
    
    lvarQuery = "SELECT * FROM BRANCH WHERE BRA_KEY=" & cmbFOR_BRA_BRANCH.ItemData(cmbFOR_BRA_BRANCH.ListIndex)
    Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenForwardOnly)
    
    'txtFOR_BRA_VAT_NO = IIf(IsNull(lvarRS("BRA_VAT_NO")), "", lvarRS("BRA_VAT_NO"))
End Sub

Private Sub cmbFOR_ASO_ASSESOR_click()
    Dim lvarRS As DAO.Recordset
    Dim lvarQuery As String
    
    lvarQuery = "SELECT * FROM ASSESOR WHERE ASO_KEY=" & cmbFOR_ASO_ASSESOR.ItemData(cmbFOR_ASO_ASSESOR.ListIndex)
    Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenForwardOnly)
    
    txtFOR_ASO_TEL = IIf(IsNull(lvarRS("ASO_TEL")), "", lvarRS("ASO_TEL"))
End Sub

Private Sub cmdAddReminder_Click()
    Dim lvarFrm As New frmReminders
    lvarFrm.mvarASS_KEY = mvarASS_KEY
    lvarFrm.mvarAction = "ADD"
    lvarFrm.Show vbModal
End Sub

Private Sub cmdBlankDate_Click()
    txtASS_DATE_UPLIFTED = ""
End Sub

Private Sub cmdClear_Click()
    picASS_DAMAGE_PICTURE.Cls
    picASS_DAMAGE_PICTURE.Picture = LoadPicture(VB.App.Path & "\blank.jpg")
End Sub

Private Sub fetch_images()
    Dim lvarCounter As Long
    Dim lvarFSO As New FileSystemObject
    Dim lvarFolder As Folder
    Dim lvarFileBase As String
    Dim lvarFile As String
    Dim lvarPrefix As String
    
    Set lvarFSO = New FileSystemObject
    
    If mvarRE_ASSESSMENT Then
        lvarPrefix = "RE-"
    Else
        lvarPrefix = ""
    End If
    
    lvarFileBase = gvarConfig.ImagePath & lvarPrefix & "\" & txtASS_INVOICE_NO & "_"
    For lvarCounter = 0 To picASS_PHOTO.UBound
        lvarFile = lvarFileBase & Trim(Str(lvarCounter + 1)) & "."
        
        If lvarFSO.FileExists(lvarFile & "jpg") Then
            'Internal Filing (BY KEY BECAUSE INVOICE CAN CHANGE)
            lvarFSO.CopyFile lvarFile & "jpg", gvarPhotoPath & lvarPrefix & mvarASS_KEY & "_" & lvarCounter & ".jpg", True
            picASS_PHOTO(lvarCounter).Picture = LoadPicture(gvarPhotoPath & lvarPrefix & mvarASS_KEY & "_" & lvarCounter & ".jpg")
            txtASS_PHOTO(lvarCounter) = lvarPrefix & mvarASS_KEY & "_" & lvarCounter & ".jpg"
        ElseIf lvarFSO.FileExists(lvarFile & "gif") Then
            'Internal Filing
            lvarFSO.CopyFile lvarFile & "gif", gvarPhotoPath & lvarPrefix & mvarASS_KEY & "_" & lvarCounter & ".gif", True
            picASS_PHOTO(lvarCounter).Picture = LoadPicture(gvarPhotoPath & lvarPrefix & mvarASS_KEY & "_" & lvarCounter & ".gif")
            txtASS_PHOTO(lvarCounter) = lvarPrefix & mvarASS_KEY & "_" & lvarCounter & ".gif"
        End If
    Next
End Sub

Private Sub cmdClearDOL_Click()
    txtASS_DATE_OF_LOSS = ""
End Sub

Private Function file_pdf(aFile As String, aType As Long, Optional aFilename As String = "") As Boolean
    Dim lvarFSO As FileSystemObject
    Dim lvarAutoFilePath As String
    Dim lvarTemp As String
    
    On Error Resume Next
    
    'get folder in which it should be filed
    lvarAutoFilePath = get_assessment_path(mvarASS_KEY, aType)
    
    'make sure folder exists/create it
    If Not Check_Dir(lvarAutoFilePath, True) Then
        file_pdf = False
        On Error GoTo 0
        Exit Function
    End If
    
    If aFilename = "" Then
        Select Case (aType)
            Case pthAuthorisations:
                lvarTemp = IIf(mvarRE_ASSESSMENT, "RE-", "") & txtASS_INVOICE_NO & "_auth.pdf"
            Case pthReports:
                lvarTemp = IIf(mvarRE_ASSESSMENT, "RE-", "") & txtASS_INVOICE_NO & "_report.pdf"
            'TODO: Figure out how to build these paths
            'Case pthStatistics:
            '    lvarTemp = IIf(mvarRE_ASSESSMENT, "RE-", "") & txtASS_INVOICE_NO & "_auth.pdf"
            'Case pthStatements:
            '    lvarTemp = IIf(mvarRE_ASSESSMENT, "RE-", "") & txtASS_INVOICE_NO & "_auth.pdf"
        End Select

        'get the files name
        lvarAutoFilePath = lvarAutoFilePath & lvarTemp
    Else
        lvarAutoFilePath = lvarAutoFilePath & aFilename
    End If
    'make it a unique filename
    lvarAutoFilePath = unique_file(lvarAutoFilePath)

    'copy the file
    VBA.FileCopy aFile, lvarAutoFilePath

    file_pdf = True
    On Error GoTo 0
    Exit Function
errorhandler:
    file_pdf = False
    On Error GoTo 0
End Function

'Stuff to do with the actual assessment
Private Sub cmdDO_Click()
'    Dim lvarQuery As String
'    Dim lvarRS As DAO.Recordset
'    Dim lvarFSO As New FileSystemObject
'    Dim lvarCounter As Long
'    Dim lvarFile As File
'    Dim lvarAutoFilePath As String
'    Dim lvarFolder As Folder
'
'    Select Case cmbDO.List(cmbDO.ListIndex)
'        Case "Generate Blank Report"
'            repControl.filename = VB.App.Path & "\blank.rep"
'            repControl.SetDatabaseConnectionString "ASSESSOR", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & VB.App.Path & "\assessment.mdb;Persist Security Info=False"
'            repControl.SetParamValue "DMG_PIC", VB.App.Path & "\blank.jpg"
'            repControl.Preview = False
'            repControl.ShowPrintDialog = True
'            repControl.ShowProgress = False
'
'            CD2.filename = "blank.pdf"
'            On Error GoTo errorhandler
'            CD2.ShowSave
'
'            If CD2.filename <> "" Then
'                Call repControl.SaveToPDF(CD2.filename, False)
'                'repControl.Execute
'            End If
'        Case "Save"
'            'Save image
'            txtASS_DAMAGE_PICTURE = mvarASS_KEY & ".jpg"
'            SavePicture picASS_DAMAGE_PICTURE.Image, gvarDamagePath & txtASS_DAMAGE_PICTURE
'            update_assessment 'photos also saved here
'            file_photos mvarASS_KEY, True
'            list_assessments
'        Case "Authorisation Letter"
'            If chkASS_AUTHORISED.Value = CheckBoxConstants.vbChecked Then
'                repControl.filename = VB.App.Path & "\authorise.rep"
'                repControl.SetDatabaseConnectionString "ASSESSOR", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & VB.App.Path & "\assessment.mdb;Persist Security Info=False"
'                repControl.SetParamValue "VAR_ASS_KEY", mvarASS_KEY
'                repControl.Preview = False
'                repControl.ShowPrintDialog = True
'                repControl.ShowProgress = False
'                On Error GoTo errorhandler
'                CD2.filename = txtASS_INVOICE_NO & "_auth.pdf"
'                'CD2.FileTitle = txtASS_INVOICE_NO & ".pdf"
'                CD2.ShowSave
'
'                If CD2.filename <> "" Then
'                    'Save to PDF
'                    Call repControl.SaveToPDF(CD2.filename, False)
'                    'Auto File PDF
'                    If Not (file_pdf(CD2.filename, pthAuthorisations)) Then
'                        MsgBox "Error: could not auto file the PDF!", vbOKOnly, "Error:"
'                    End If
'
'                    'Set The Letter as generated
'                    gvarDatabase.Execute "UPDATE ASSESSMENT SET ASS_DATE_AUTHORISED_SENT=true", dbOpenForwardOnly
'                    'Email it
'                    If MsgBox("Send as Email?", vbYesNo, "Email") = vbYes Then
'                        send_mail "Authorisation Letter", "Authorisation Letter", "", CD2.filename
'                    End If
'                End If
'            Else
'                MsgBox "Error: Assessment(" & txtASS_INVOICE_NO & ") Not Yet Authorised!", vbOKOnly, "Error!"
'            End If
'        Case "Generate PDF"
'            repControl.filename = VB.App.Path & "\report.rep"
'            repControl.SetDatabaseConnectionString "ASSESSOR", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & VB.App.Path & "\assessment.mdb;Persist Security Info=False"
'            repControl.SetParamValue "ASS_KEY", mvarASS_KEY
'            repControl.SetParamValue "PIC_PATH", gvarPhotoPath
'            repControl.SetParamValue "DMG_PATH", gvarDamagePath
'
'            repControl.Preview = False
'            repControl.ShowPrintDialog = True
'            repControl.ShowProgress = False
'            CD2.filename = txtASS_INVOICE_NO & ".pdf"
'            'CD2.FileTitle = txtASS_INVOICE_NO & ".pdf"
'            On Error GoTo errorhandler
'            CD2.ShowSave
'
'            If CD2.filename <> "" Then
'                'Create report
'                Call repControl.SaveToPDF(CD2.filename, False)
'
'                'auto file the PDF
'                If Not (file_pdf(CD2.FileTitle, pthReports)) Then
'                    MsgBox "Error: could not auto file the PDF!", vbOKOnly, "Error:"
'                End If
'
'                'repControl.Execute
'                gvarDatabase.Execute "UPDATE ASSESSMENT SET ASS_REPORTED=true", dbOpenForwardOnly
'
'                'send by mail
'                If MsgBox("Send as Email?", vbYesNo, "Email") = vbYes Then
'                    send_mail "ASSESSMENT " & txtASS_INVOICE_NO, "ASSESSMENT " & txtASS_INVOICE_NO, "", CD2.filename
'                End If
'            End If
'        Case "Import Images"
'            fetch_images
'        Case "Status Flags"
'            frmStatus.Show vbModal
'            Fill_Form
'        Case Else
'            'not a valid choice throw error and die
'    End Select
'
'    'To Avoid Date Click
'    If txtASS_INVOICE_NO.Enabled And txtASS_INVOICE_NO.Visible Then
'        txtASS_INVOICE_NO.SetFocus
'    End If
'
'    Exit Sub
'errorhandler:
'    'do diddly
'    MsgBox VBA.err.Number & ":" & VBA.err.Description
'    On Error GoTo 0
End Sub

'Private Sub cmdDelete_Click()
'    Dim lvarQuery As String
'    Dim lvarFSO As New FileSystemObject
'    Dim lvarCounter As Long
'    Dim lvarFile As File
'    Dim lvarFolder As Folder
'
'    If MsgBox("Are you sure you wish to delete the assessment", vbYesNo, "Delete Assessment") = vbYes Then
'        lvarQuery = "DELETE FROM ASSESSMENT WHERE ASS_KEY = " & lstAssessments.ItemData(lstAssessments.ListIndex)
'        gvarDatabase.Execute (lvarQuery)
'
'        If lvarFSO.FileExists(VB.App.Path & "\" & mvarASS_KEY & ".bmp") Then
'            lvarFSO.DeleteFile VB.App.Path & "\" & mvarASS_KEY & ".bmp", True
'        End If
'
'        Set lvarFolder = lvarFSO.GetFolder(VB.App.Path & "\photos\")
'        For Each lvarFile In lvarFolder.Files
'            If UCase(lvarFile.Name) Like "" & mvarASS_KEY & "P_#.???" Then
'                lvarFile.delete True
'            End If
'        Next
'
'        clear_form
'        able_form False
'        list_assessments
'        cmdSelect.Enabled = False
'        cmdDelete.Enabled = False
'    End If
'End Sub

'Private Sub cmdGo_Click()
'    Dim lvarQuery As String
'    Dim lvarRS As DAO.Recordset
'    Dim lvarFSO As New FileSystemObject
'    Dim lvarCounter As Long
'    Dim lvarFile As File
'    Dim lvarFolder As Folder
'    Dim lvarASS_KEY_NEW As String
'    Dim lvarASS_KEY As String
'
'    Select Case cmbGO.List(cmbGO.ListIndex)
'        Case "Select Assessment"
'            load_assessment
'        Case "Re-Assess"
'            load_assessment
'
'            txtASS_DATE_INSTRUCTED.Text = VBA.Date
'            txtASS_DATE_ASSESSED.Text = VBA.Date
'
'            save_assessment True
'
'            list_assessments
'            able_form True
'        Case "New Assessment"
'            clear_form
'
'            'Set assessed today
'            txtASS_DATE_ASSESSED.Text = VBA.Date
'            txtASS_DATE_INSTRUCTED.Text = VBA.Date
'
'            'get max Key
'            lvarQuery = "SELECT MAX (ASS_INVOICE_NO) FROM ASSESSMENT"
'
'            Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenSnapshot)
'            If lvarRS.EOF Then 'No previous assessments
'                txtASS_INVOICE_NO = "0"
'            Else
'                txtASS_INVOICE_NO = IIf(IsNull(lvarRS(0).Value), "0", lvarRS(0).Value + 1)
'            End If
'
'            save_assessment
'            list_assessments
'
'            able_form True
'        Case "Delete Assessment"
'            If MsgBox("Are you sure you wish to delete the assessment: " & lstAssessments.List(lstAssessments.ListIndex), vbYesNo, "Delete Assessment") = vbYes Then
'                lvarQuery = "DELETE FROM ASSESSMENT WHERE ASS_KEY = " & lstAssessments.ItemData(lstAssessments.ListIndex)
'                gvarDatabase.Execute (lvarQuery)
'
'                'get rid of useless image
'                If lvarFSO.FileExists(VB.App.Path & "\" & mvarASS_KEY & ".bmp") Then
'                    lvarFSO.DeleteFile VB.App.Path & "\" & mvarASS_KEY & ".bmp", True
'                End If
'
'                If lvarFSO.FolderExists(gvarPhotoPath) Then
'                    Set lvarFolder = lvarFSO.GetFolder(gvarPhotoPath)
'                    'For Each lvarFile In lvarFolder.Files
'                    '    If UCase(lvarFile.Name) Like "" & mvarASS_KEY & "P_#.???" Then
'                    '        lvarFile.delete True
'                    '    End If
'                    'Next
'                End If
'                clear_form
'                able_form False
'                list_assessments
'            End If
'
'        Case Else
'            ' not a valid choice throw error and die
'    End Select
'    'Rebuild Action Lists
'    build_lists
'End Sub

'Private Sub cmdRUN_Click()
'    Dim lvarQuery As String
'    Dim lvarRS As DAO.Recordset
'    Dim lvarRS2 As DAO.Recordset
'    Dim lvarFSO As New FileSystemObject
'    Dim lvarCounter As Long
'    Dim lvarFile As File
'    Dim lvarFolder As Folder
'    Dim lvarControl As Control
'    Dim lvarPos As String
'    Dim lvarKey As String
'    Dim lvarTable As String
'    Dim kvarControl As Control
'
'    Select Case cmbACTION.List(cmbACTION.ListIndex)
'        Case "Reminders"
'            Dim lvarFrm As New frmReminders
'            lvarFrm.mvarASS_KEY = ""
'            lvarFrm.mvarAction = ""
'            lvarFrm.Show vbModal
'        Case "Branch"
'            frmBranch.Show vbModal
'        Case "Insurance"
'            frmInsurance.Show vbModal
'        Case "Clark"
'            frmClark.Show vbModal
'        Case "Assessor"
'            frmAssessor.Show vbModal
'        Case "Monthly Reports"
'            frmReports.Show vbModal
'        Case "Configure"
'            frmConfig.Show vbModal
'        Case "Company"
'            frmCompany.Show vbModal
'        Case "Fix Data"
'            If MsgBox("Fix Data?", vbYesNo, "Fix Data") = vbYes Then
'                modDataFix.fix_data
'            End If
'        Case "Fix Images"
'            If MsgBox("Fix Images?", vbYesNo, "Fix Images") = vbYes Then
'                Set lvarControl = frmMain.Controls("PicFormat321")
'                modDataFix.fix_images lvarControl
'                'modDataFix.fix_images
'            End If
'        Case Else
'            ' not a valid choice throw error and die
'    End Select
'
'    'Update things
'    'rebuild foreign lists
'    For Each lvarControl In Me.Controls
'        If UCase(lvarControl.Name) Like "CMBFOR*" Then
'            lvarPos = lvarControl.ListIndex 'Remember where we are
'            lvarKey = Mid(lvarControl.Name, 8, 3) & "_KEY"
'            lvarTable = Mid(lvarControl.Name, 12)
'
'            lvarQuery = "SELECT * FROM " & lvarTable & " ORDER BY " & Mid(lvarControl.Name, 8, 3) & "_NAME"
'            Set lvarRS2 = gvarDatabase.OpenRecordset(lvarQuery, dbOpenForwardOnly)
'            Do While Not lvarRS2.EOF
'                lvarControl.AddItem lvarRS2(Mid(lvarControl.Name, 8, 3) & "_NAME")
'                lvarControl.ItemData(lvarControl.NewIndex) = lvarRS2(lvarKey)
'                lvarRS2.MoveNext
'            Loop
'
'            lvarControl.ListIndex = lvarPos
'        End If
'    Next
'    're list reminders
'    check_reminders
'End Sub

Private Sub cmdSEARCH_Click()
    Dim lvarRS As DAO.Recordset
    Dim lvarQuery As String
    Dim lvarDate As String
    Dim lvarField
    Dim lvarCounter As Long
    Dim lvarPosition As Long
    
    If txtSEARCH <> "" Then
        lstAssessments.Clear
        Select Case (cmbSEARCH.ListIndex)
            Case 0:
                lvarField = "ASS_INSURANCE_CLAIM_NO"
            Case 1:
                lvarField = "ASS_INSURED"
            Case 2:
                lvarField = "ASS_INSURANCE_POLICY_NO"
            Case 3:
                lvarField = "ASS_VEHICLE_REGISTRATION"
            Case 4:
                lvarField = "ASS_INVOICE_NO"
            Case 5:
                lvarField = "ASS_REPAIRER"
        End Select
        
        lvarQuery = "SELECT ASS_INVOICE_NO, ASS_DATE_ASSESSED, ASS_KEY "
        lvarQuery = lvarQuery & "FROM ASSESSMENT "
        lvarQuery = lvarQuery & "WHERE "
        lvarQuery = lvarQuery & lvarField & " LIKE '*" & txtSEARCH & "*' "
        lvarQuery = lvarQuery & "ORDER BY ASS_DATE_ASSESSED , ASS_INVOICE_NO"
        
        'TODO: Add from date/date range criteria
        
        'On Error GoTo errorhandler
        'InputBox lvarQuery, , lvarQuery
        Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenSnapshot)
    
        If lvarRS.EOF Then 'Do nothing Nothing to list
            MsgBox "No Matches for '" & cmbSEARCH.List(cmbSEARCH.ListIndex) & "' like '" & txtSEARCH & "'", vbOKOnly, "Search"
        Else
            Do While Not lvarRS.EOF
                lstAssessments.AddItem "(" & lvarRS("ASS_DATE_ASSESSED") & " ) - " & lvarRS("ASS_INVOICE_NO")
                lstAssessments.ItemData(lstAssessments.NewIndex) = lvarRS("ASS_KEY")
                lvarRS.MoveNext
            Loop
        
            lvarPosition = 0
            For lvarCounter = 0 To lstAssessments.ListCount - 1
                If lstAssessments.ItemData(lvarCounter) = Val(mvarASS_KEY) Then
                    lvarPosition = lvarCounter
                    Exit For
                End If
            Next
            
            lstAssessments.Enabled = True
            lstAssessments.ListIndex = lvarPosition
        End If
    End If
    Exit Sub
errorhandler:
    'do diddly squat
    On Error GoTo 0
End Sub

Private Sub list_foreign()
    Dim lvarRS0 As DAO.Recordset
    Dim lvarRS2 As DAO.Recordset
    
    Dim lvarQuery As String
    Dim lvarKey As String
    Dim lvarTable As String
    Dim lvarControl As Control
    Dim lvarPos As Long
    
    If mvarASS_KEY > 0 Then
        Set lvarRS0 = gvarDatabase.OpenRecordset("SELECT * FROM ASSESSMENT WHERE ASS_KEY = " & mvarASS_KEY, dbOpenForwardOnly)
        If lvarRS0.EOF Then
            'InValid
            'stsBar.SimpleText = "Please select a Valid Assessment"
            'Cancel = True
        Else
            'Valid
            'stsBar.SimpleText = ""
            mvarASS_KEY = lvarRS0("ASS_KEY")
            For Each lvarControl In Me.Controls
                If TypeName(lvarControl) = "ComboBox" And UCase(lvarControl.Name) Like "???FOR_*" Then
                    'TODO:look at tag for table and field to display
                    lvarControl.Clear
                    lvarPos = 0
                    lvarKey = Mid(lvarControl.Name, 8, 3) & "_KEY"
                    lvarTable = Mid(lvarControl.Name, 12)
                    lvarQuery = "SELECT * FROM " & lvarTable & " ORDER BY " & Mid(lvarControl.Name, 8, 3) & "_NAME"
                    Set lvarRS2 = gvarDatabase.OpenRecordset(lvarQuery, dbOpenForwardOnly)
                    Do While Not lvarRS2.EOF
                        lvarControl.AddItem lvarRS2(Mid(lvarControl.Name, 8, 3) & "_NAME")
                        lvarControl.ItemData(lvarControl.NewIndex) = lvarRS2(lvarKey)
                        If lvarRS0(lvarKey) = lvarRS2(lvarKey) Then
                            lvarPos = lvarControl.NewIndex
                        End If
                        lvarRS2.MoveNext
                    Loop
                    
                    lvarControl.ListIndex = lvarPos
                End If
            Next
        End If
    End If
End Sub

Private Sub Form_Activate()
    
    set_header
    list_foreign
    'If txtASS_INVOICE_NO.Enabled And txtASS_INVOICE_NO.Visible Then
    '    txtASS_INVOICE_NO.SetFocus
    'End If
End Sub

Private Function check_reminders() As Boolean
    Dim lvarRS As DAO.Recordset
    Dim lvarQuery As String
    Dim lvarRS2 As DAO.Recordset
    Dim lvarQuery2 As String
    '
    'Get a List of all the Assessments With REMINDERs
        
    'Clear List
    lstReminders.Clear
    
    lvarQuery = "SELECT DISTINCT REMINDER.ASS_KEY," & _
                " ASS_RE_ASSESSMENT,ASS_INVOICE_NO " & _
                " FROM " & _
                "(REMINDER INNER JOIN ASSESSMENT " & _
                " ON REMINDER.ASS_KEY = ASSESSMENT.ASS_KEY)" & _
                " ORDER BY ASS_INVOICE_NO"
    Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenForwardOnly)
    
    If lvarRS.EOF Then
        'msgbox "Sorry there are no REMINDERs for any Assessments!"
        'Disable form
        'able_form False
        check_reminders = False
    Else
        lstReminders.AddItem "Reports - Action Date - Note"
        Do While Not lvarRS.EOF
            lvarQuery2 = "SELECT * FROM REMINDER WHERE ASS_KEY=" & lvarRS("ASS_KEY") & _
            " AND " & _
                " NOT (NOT_NOTIFY_FROM IS NULL) AND NOT_COMPLETED=0 AND " & _
                " NOT_NOTIFY_FROM <= #" & Format(VBA.Date, "dd-mmm-yyyy") & "#" & _
                " ORDER BY NOT_NOTIFY_FROM"
            Set lvarRS2 = gvarDatabase.OpenRecordset(lvarQuery2, dbOpenForwardOnly)
            Do While Not lvarRS2.EOF
                lstReminders.AddItem IIf(IsNull(lvarRS("ASS_RE_ASSESSMENT")), "RE-", "") & _
                                     lvarRS("ASS_INVOICE_NO") & " : " & _
                                     Format(lvarRS2("NOT_NOTIFY_FROM"), "dd-mmm-yyyy") & " - " & _
                                     lvarRS2("NOT_NOTE")
                lvarRS2.MoveNext
            Loop
            lvarRS.MoveNext
        Loop
        lstReminders.Enabled = True
        check_reminders = True
    End If
    'check for notes past or on notify date that are not complete
    'Show list form if we found any
    'return to main program
End Function

Private Sub Form_GotFocus()
    'MsgBox "Me"
    If txtASS_INVOICE_NO.Enabled And txtASS_INVOICE_NO.Visible Then
        txtASS_INVOICE_NO.SetFocus
    End If
End Sub

Private Sub Form_Load()
    Dim lvarControl As Control
    Dim lvarTXT As TextBox
    
    'Show Name of company
    set_header
    
    mvarLIST_CLICK = True
    'Set dates to today and correct sizes
    For Each lvarControl In Controls
        If TypeName(lvarControl) = "Calendar" Then
            'Set Calendars dates to today
            lvarControl.Value = VBA.Date
            
            'Fix issues with calendars
            lvarControl.DayFont.Size = 8
            lvarControl.GridFont.Size = 8
            lvarControl.ShowTitle = False
            lvarControl.DayLength = 1
        End If
    Next
    
    'Hide and show
    frmAssessment.Visible = False
    frmVehicle.Visible = False
    frmNotes.Visible = False
    frmPhotos.Visible = False
    frmPhotos2.Visible = False
    frmPhotos3.Visible = False
    frmCosting.Visible = False
    frmReminders.Visible = False
    
    'Hide photo texts
    For Each lvarTXT In txtASS_PHOTO
        lvarTXT.Visible = False
    Next
    
    'Clear all data
    clear_form
    
    'set date
    txtDate = "1-" & VBA.MonthName(Month(VBA.Date), True) & "-" & VBA.Year(VBA.Date)
    
    'Show all assessments
    list_assessments
    
    'Build non changing lists
    list_once
    
    'Lock up form
    able_form False
    
    'Here we show summary of notes
    If check_reminders Then
        tabMain.Tabs.Item(8).Selected = True
    Else
        tabMain.Tabs.Item(1).Selected = True
    End If
End Sub

Private Sub save_assessment(Optional ReAssess As Boolean = False)
    Dim lvarControl As Control
    Dim lvarQuery As String
    
    Dim lvarFields() As String
    Dim lvarValues() As String
    
    Dim lvarTemp As String
    Dim lvarCounter As Long
    
    lvarQuery = "INSERT INTO ASSESSMENT (" & vbCrLf
    lvarCounter = 1
    For Each lvarControl In Controls
        If TypeName(lvarControl) = "TextBox" And Trim(UCase(lvarControl.Name)) Like "TXTASS*" Then
            If VarType(Me(lvarControl.Name)) = vbObject Then
                lvarTemp = Trim(Mid(lvarControl.Name, 4)) & "_" & Trim(Str(lvarControl.index + 1))
            Else
                lvarTemp = Mid(lvarControl.Name, 4)
            End If
            
            If lvarCounter = 1 Then
                lvarQuery = lvarQuery & lvarTemp
                lvarCounter = 2
            Else
                lvarQuery = lvarQuery & "," & vbCrLf & lvarTemp
            End If
        End If
            
        If ReAssess And TypeName(lvarControl) = "ComboBox" And Trim(UCase(lvarControl.Name)) Like "CMBFOR*" Then
            
            lvarTemp = Mid(lvarControl.Name, 8, 3) & "_KEY"
            
            If lvarCounter = 1 Then
                lvarQuery = lvarQuery & lvarTemp
                lvarCounter = 2
            Else
                lvarQuery = lvarQuery & "," & vbCrLf & lvarTemp
            End If
        End If
            
        If ReAssess And TypeName(lvarControl) = "ComboBox" And Trim(UCase(lvarControl.Name)) Like "CMBASS*" Then
            
            lvarTemp = Mid(lvarControl.Name, 4)
            
            If lvarCounter = 1 Then
                lvarQuery = lvarQuery & lvarTemp
                lvarCounter = 2
            Else
                lvarQuery = lvarQuery & "," & vbCrLf & lvarTemp
            End If
        End If
    Next
    
    If (ReAssess) Then
        lvarQuery = lvarQuery & ", " & vbCrLf & "ASS_RE_ASSESSMENT"
    End If
    
    lvarQuery = lvarQuery & vbCrLf & ") VALUES (" & vbCrLf
    
    For Each lvarControl In Controls
        If TypeName(lvarControl) = "TextBox" And Trim(UCase(lvarControl.Name)) Like "TXTASS*" Then
            If lvarCounter = 2 Then
                If lvarControl.Text = "" Then
                    lvarQuery = lvarQuery & "NULL" & vbCrLf
                Else
                    If UCase(lvarControl.Name Like "*DATE*") Then
                        lvarQuery = lvarQuery & "#" & lvarControl.Text & "#"
                    Else
                        lvarQuery = lvarQuery & "'" & lvarControl.Text & "'"
                    End If
                End If
                lvarCounter = 3
            Else
                If lvarControl.Text = "" Then
                    lvarQuery = lvarQuery & ",NULL" & vbCrLf
                Else
                    If UCase(lvarControl.Name Like "*DATE*") Then
                        lvarQuery = lvarQuery & ",#" & lvarControl.Text & "#" & vbCrLf
                    Else
                        lvarQuery = lvarQuery & ",'" & lvarControl.Text & "'" & vbCrLf
                    End If
                End If
            End If
        End If
        
        If ReAssess And TypeName(lvarControl) = "ComboBox" And Trim(UCase(lvarControl.Name)) Like "CMBFOR*" Then
            lvarTemp = lvarControl.ItemData(lvarControl.ListIndex)
            
            If lvarCounter = 2 Then
                lvarQuery = lvarQuery & lvarTemp
                lvarCounter = 3
            Else
                lvarQuery = lvarQuery & "," & vbCrLf & lvarTemp
            End If
            
        End If
        
        If ReAssess And TypeName(lvarControl) = "ComboBox" And Trim(UCase(lvarControl.Name)) Like "CMBASS*" Then
            lvarTemp = lvarControl.ItemData(lvarControl.ListIndex)
            
            If lvarCounter = 2 Then
                lvarQuery = lvarQuery & lvarTemp
                lvarCounter = 3
            Else
                lvarQuery = lvarQuery & "," & vbCrLf & lvarTemp
            End If
        
        End If
        
    Next
    
    'lvarQuery = "INSERT INTO ASSESSMENT ("
    'lvarQuery = lvarQuery & "ASS_INVOICE_NO,ASS_DATE_ASSESSED"
    
    'If (ReAssess) Then
    '    lvarQuery = lvarQuery & ",ASS_RE_ASSESSMENT"
    'End If
    'lvarQuery = lvarQuery & ") VALUES ("
    
    'lvarQuery = lvarQuery & "'" & txtASS_INVOICE_NO & "'" & ",#" & txtASS_DATE_ASSESSED & "# "
    
    If (ReAssess) Then
        lvarQuery = lvarQuery & ",true"
    End If
    
    lvarQuery = lvarQuery & ")"
    
    On Error GoTo errorhandler
    DBEngine.BeginTrans
    'Add Record
    'send_mail "TEST", lvarQuery
    gvarDatabase.Execute lvarQuery, dbFailOnError
    DBEngine.CommitTrans
    
    'Get Key
    mvarASS_KEY = gvarDatabase.OpenRecordset("SELECT MAX(ASS_KEY) AS THE_KEY FROM ASSESSMENT", dbOpenSnapshot)("THE_KEY")
    
    MsgBox "Success Saving Assessment"
    Fill_Form
    Exit Sub

errorhandler:
    DBEngine.Rollback
    MsgBox DBEngine.Errors(0).Number & " - " & DBEngine.Errors(0).Description
    On Error GoTo 0
End Sub

Private Sub update_assessment()
    Dim lvarControl As Control
    Dim lvarQuery As String
    Dim lvarTemp As String
    Dim lvarSQL As String
    
    lvarQuery = "UPDATE ASSESSMENT SET " & vbCrLf
    
    For Each lvarControl In Controls
        'MsgBox lvarControl.Name
        If TypeName(lvarControl) = "TextBox" And Trim(UCase(lvarControl.Name)) Like "TXTASS*" Then
            If VarType(Me(lvarControl.Name)) = vbObject Then
                lvarTemp = Trim(Mid(lvarControl.Name, 4)) & "_" & Trim(Str(lvarControl.index + 1))
            Else
                 lvarTemp = Trim(Mid(lvarControl.Name, 4))
            End If
            
            If lvarControl = "" Then
                lvarQuery = lvarQuery & lvarTemp & "= NULL," & vbCrLf
            Else
                lvarQuery = lvarQuery & lvarTemp & "=""" & Replace(lvarControl.Text, """", """""") & """," & vbCrLf
            End If
            
            'Else
            '    lvarQuery = lvarQuery & Mid(lvarControl.Name, 4) & "=""" & Replace(lvarControl.Text, """", """""") & """," & vbCrLf
            'End If
        End If
        If TypeName(lvarControl) = "CheckBox" And Trim(UCase(lvarControl.Name)) Like "CHKASS*" Then
            If lvarControl.Value = 1 Then
                lvarQuery = lvarQuery & Mid(lvarControl.Name, 4) & "=true,"
            Else
                lvarQuery = lvarQuery & Mid(lvarControl.Name, 4) & "=false,"
            End If
        End If
        'TODO:
        If TypeName(lvarControl) = "ComboBox" And Trim(UCase(lvarControl.Name)) Like "CMBFOR*" Then
            lvarQuery = lvarQuery & Mid(lvarControl.Name, 8, 3) & "_KEY" & "=""" & lvarControl.ItemData(lvarControl.ListIndex) & """," & vbCrLf
        End If
        If TypeName(lvarControl) = "ComboBox" And Trim(UCase(lvarControl.Name)) Like "CMBASS*" Then
            lvarQuery = lvarQuery & Mid(lvarControl.Name, 4) & "=" & lvarControl.ItemData(lvarControl.ListIndex) & "," & vbCrLf
        End If
    Next
    
    lvarQuery = Left(lvarQuery, Len(lvarQuery) - 3) & " WHERE ASS_KEY = " & mvarASS_KEY
    
    On Error GoTo errorhandler
    DBEngine.BeginTrans
    gvarDatabase.Execute lvarQuery, dbFailOnError
    DBEngine.CommitTrans
    
    On Error GoTo 0
    MsgBox "Success Updating Assessment"
    
    Exit Sub
errorhandler:
    DBEngine.Rollback
    MsgBox DBEngine.Errors(0).Number & " - " & DBEngine.Errors(0).Description
    On Error GoTo 0
End Sub

Private Sub Fill_Form()
    Dim lvarRS0 As DAO.Recordset
    Dim lvarRS1 As DAO.Recordset
    Dim lvarRS2 As DAO.Recordset
    Dim lvarTemp As String
    Dim lvarQuery As String
    Dim lvarKey As String
    Dim lvarTable As String
    Dim lvarControl As Control
    Dim lvarControl1 As Control
    Dim lvarFSO As FileSystemObject
    Dim lvarPos As Long
    Dim lvarArrCounter As Long
    Dim lvarTemp1 As String
    
    'DBEngine.BeginTrans
    Set lvarRS0 = gvarDatabase.OpenRecordset("SELECT * FROM ASSESSMENT WHERE ASS_KEY = " & mvarASS_KEY, dbOpenForwardOnly)
    Set lvarFSO = New FileSystemObject
    If lvarRS0.EOF Then
        'InValid
        'stsBar.SimpleText = "Please select a Valid Assessment"
        'Cancel = True
    Else 'Valid
        mvarASS_KEY = lvarRS0("ASS_KEY")
        mvarRE_ASSESSMENT = IIf(IsNull(lvarRS0("ASS_RE_ASSESSMENT")), False, lvarRS0("ASS_RE_ASSESSMENT"))
        For Each lvarControl In Me.Controls
            If TypeName(lvarControl) = "TextBox" And UCase(lvarControl.Name) Like "???ASS_*" Then
                If VarType(Me(lvarControl.Name)) = vbObject Then
                    lvarTemp = Trim(Mid(lvarControl.Name, 4)) & "_" & Trim(Str(lvarControl.index + 1))
                Else
                    lvarTemp = Mid(lvarControl.Name, 4)
                End If
                
                lvarControl.Text = IIf(IsNull(lvarRS0(lvarTemp)), "", lvarRS0(lvarTemp))
                'Else
                '    lvarControl.Text = IIf(IsNull(lvarRS0(Mid(lvarControl.Name, 4))), "", lvarRS0(Mid(lvarControl.Name, 4)))
                'End If
            ElseIf TypeName(lvarControl) = "CheckBox" And UCase(lvarControl.Name) Like "???ASS_*" Then
                'MsgBox Mid(lvarControl.Name, 4)
                lvarControl.Value = IIf(lvarRS0(Mid(lvarControl.Name, 4)) = 0, 0, 1)
            ElseIf TypeName(lvarControl) = "ComboBox" And UCase(lvarControl.Name) Like "???FOR_*" Then
                'TODO:look at tag for table and field to display
                lvarPos = 0
                lvarKey = Mid(lvarControl.Name, 8, 3) & "_KEY"
                lvarTable = Mid(lvarControl.Name, 12)
                lvarQuery = "SELECT * FROM " & lvarTable & " ORDER BY " & Mid(lvarControl.Name, 8, 3) & "_NAME"
                Set lvarRS2 = gvarDatabase.OpenRecordset(lvarQuery, dbOpenForwardOnly)
                
                lvarControl.Clear
                
                Do While Not lvarRS2.EOF
                    lvarControl.AddItem lvarRS2(Mid(lvarControl.Name, 8, 3) & "_NAME")
                    'MsgBox lvarControl.NewIndex
                    lvarControl.ItemData(lvarControl.NewIndex) = lvarRS2(lvarKey)
                    If lvarRS0(lvarKey) = lvarRS2(lvarKey) Then
                        lvarPos = lvarControl.NewIndex
                    End If
                    lvarRS2.MoveNext
                Loop
                
                lvarControl.ListIndex = lvarPos
                'build list KEY FROM Control Name
                'if selected select
           'ElseIf TypeName(lvarControl) = "ListBox" And UCase(lvarControl.Name) Like "???ASS_*" Then
                
            ElseIf TypeName(lvarControl) = "Image" Then
                If VarType(Me(lvarControl.Name)) = vbObject Then
                    lvarTemp = Trim(Mid(lvarControl.Name, 4)) & "_" & Trim(Str(lvarControl.index + 1))
                Else
                    lvarTemp = Trim(Mid(lvarControl.Name, 4))
                End If
                
                If IsNull(lvarRS0(lvarTemp)) Then
                    Set lvarControl.Picture = LoadPicture
                Else
                    If lvarRS0(lvarTemp) <> "" And lvarFSO.FileExists(gvarPhotoPath & lvarRS0(lvarTemp)) Then
                        'get from recordset
                        lvarControl.Picture = LoadPicture(gvarPhotoPath & lvarRS0(lvarTemp))
                    Else 'blank field or no file
                        'TODO: Must get this to find local picture (only name in field) / just gened name
                        Set lvarControl.Picture = LoadPicture
                    End If
                End If
                
            ElseIf TypeName(lvarControl) = "CommandButton" Then
            End If
        Next
    End If
    
    'If lvarFSO.FileExists(gvarDamagePath & mvarASS_KEY & ".jpg") Then
    If lvarFSO.FileExists(gvarDamagePath & txtASS_DAMAGE_PICTURE) Then
        picASS_DAMAGE_PICTURE = LoadPicture(gvarDamagePath & txtASS_DAMAGE_PICTURE)
        'txtASS_DAMAGE_PICTURE = txtASS_DAMAGE_PICTURE
        'modGlobal.Check_Dir
    Else
        picASS_DAMAGE_PICTURE = LoadPicture(VB.App.Path & "\blank.jpg")
        txtASS_DAMAGE_PICTURE = "blank.jpg"
    End If
    
    'See what extras we have
    'MsgBox txtASS_EXTRAS
    'build_extras_list
    
    'TODO: calendars set to correct values
    quotation_validate
    
    txtASS_OLD_DAMAGE = Format(txtASS_OLD_DAMAGE, "###0.00")
    txtASS_KILOMETRE = Format(txtASS_KILOMETRE, "###0.00")
    txtASS_TRADE_IN = Format(txtASS_TRADE_IN, "###0.00")
    txtASS_RETAIL = Format(txtASS_RETAIL, "###0.00")
    txtASS_MARKET = Format(txtASS_MARKET, "###0.00")
    
    txtASS_ASSESS_RATE = Format(txtASS_ASSESS_RATE, "###0.00")
    txtASS_ASSESS_KILOMETRES_COST = Format(txtASS_ASSESS_KILOMETRES_COST, "###0.00")
    txtASS_ASSESS_SUB_TOTAL = Format(txtASS_ASSESS_SUB_TOTAL, "###0.00")
    txtASS_ASSESS_VAT = Format(txtASS_ASSESS_VAT, "###0.00")
    txtASS_ASSESS_TOTAL = Format(txtASS_ASSESS_TOTAL, "###0.00")
    
    txtASS_AMOUNT_QUOTED = Format(txtASS_AMOUNT_QUOTED, "###0.00")
    txtASS_AMOUNT_AGREED = Format(txtASS_AMOUNT_AGREED, "###0.00")
    txtASS_DISCOUNT = Format(txtASS_DISCOUNT, "###0.00")
    txtASS_BETTERMENT = Format(txtASS_BETTERMENT, "###0.00")
    txtASS_SAVINGS = Format(txtASS_SAVINGS, "###0.00")
    txtASS_ADDITIONALS = Format(txtASS_ADDITIONALS, "###0.00")
        
    txtASS_EXCESS = Format(txtASS_EXCESS, "###0.00")
    txtASS_SUB_TOTAL_1 = Format(txtASS_SUB_TOTAL_1, "###0.00")
    txtASS_VAT = Format(txtASS_VAT, "####.00")
    txtASS_SUB_TOTAL_2 = Format(txtASS_SUB_TOTAL_2, "###0.00")
    txtASS_TOTAL = Format(txtASS_TOTAL, "###0.00")
    
    cmbASS_VEHICLE_STATE.ListIndex = IIf(IsNull(lvarRS0("ASS_VEHICLE_STATE")), 0, lvarRS0("ASS_VEHICLE_STATE"))
    'DBEngine.CommitTrans
End Sub

Private Sub list_once()
    'lstASS_EXTRAS_LIST.Clear
    'lstASS_EXTRAS_LIST.AddItem "l / Trim"
    'lstASS_EXTRAS_LIST.AddItem "aircon"
    'lstASS_EXTRAS_LIST.AddItem "p/steering"
    'lstASS_EXTRAS_LIST.AddItem "airbags"
    'lstASS_EXTRAS_LIST.AddItem "pdc"
    'lstASS_EXTRAS_LIST.AddItem "navaigation"
    'lstASS_EXTRAS_LIST.AddItem "elec seats"
    'lstASS_EXTRAS_LIST.AddItem "towbar"
    'lstASS_EXTRAS_LIST.AddItem "rollbar"
    'lstASS_EXTRAS_LIST.AddItem "bullbar."
    
    lstDamage.Clear
    lstDamage.AddItem "Old Damage - X"
    lstDamage.AddItem "Damage - ///"
    lstDamage.AddItem "Suspension - <<<"
    lstDamage.AddItem "Under Carriage - >>>"
    lstDamage.ListIndex = 0
    
    'Initialise Assessment filter
    cmbFILTER.Clear
    'cmbFILTER.AddItem "Current Month(P&U)"
    'cmbFILTER.AddItem "Current Month(P)"
    'cmbFILTER.AddItem "Current Month(U)"
    cmbFILTER.AddItem "From Date (P&U)"
    cmbFILTER.AddItem "From Date (P)"
    cmbFILTER.AddItem "From Date (U)"
    cmbFILTER.ListIndex = 0
    
    'Initiaise MAIN ACTIONS
    'cmbACTION.Clear
    'cmbACTION.AddItem "Reminders"
    'cmbACTION.AddItem "Monthly Reports"
    'cmbACTION.AddItem "---------------"
    'cmbACTION.AddItem "Insurance"
    'cmbACTION.AddItem "Branch"
    'cmbACTION.AddItem "Clark"
    'cmbACTION.AddItem "Assessor"
    'cmbACTION.AddItem "Company"
    'cmbACTION.AddItem "---------------"
    'cmbACTION.AddItem "Configure"
    'cmbACTION.AddItem "Fix Data"
    'cmbACTION.AddItem "Fix Images"
    'cmbACTION.ListIndex = 0
    
    'Initialise the seach types
    cmbSEARCH.Clear
    cmbSEARCH.AddItem "Claim Number"
    cmbSEARCH.AddItem "Insured"
    cmbSEARCH.AddItem "Policy Number"
    cmbSEARCH.AddItem "Registration"
    cmbSEARCH.AddItem "Invoice"
    cmbSEARCH.AddItem "Repairer"
    cmbSEARCH.ListIndex = 0
    
    'Initialise the seach types
    cmbASS_VEHICLE_STATE.Clear
    cmbASS_VEHICLE_STATE.AddItem "Driveable"
    cmbASS_VEHICLE_STATE.ItemData(cmbASS_VEHICLE_STATE.NewIndex) = 0
    cmbASS_VEHICLE_STATE.AddItem "Non Drivable"
    cmbASS_VEHICLE_STATE.ItemData(cmbASS_VEHICLE_STATE.NewIndex) = 1
    cmbASS_VEHICLE_STATE.AddItem "Write Off"
    cmbASS_VEHICLE_STATE.ItemData(cmbASS_VEHICLE_STATE.NewIndex) = 2
    cmbASS_VEHICLE_STATE.ListIndex = 0
End Sub

Private Sub build_lists()
    build_do
    build_go
End Sub

Private Sub build_do()
    'Initiaise Action DO
    'cmbDO.Clear
    If mvarASS_KEY > 0 Then
        mnuAssessment(4).Enabled = True
        mnuAssessment(6).Enabled = True
        mnuAssessment(7).Enabled = True
        mnuAssessment(8).Enabled = True
    Else
        mnuAssessment(4).Enabled = False
        mnuAssessment(6).Enabled = False
        mnuAssessment(7).Enabled = False
        mnuAssessment(8).Enabled = False
    End If
End Sub

Private Sub build_go()
    'Assessment Menu Build
    If lstAssessments.Enabled And lstAssessments.ListCount > 0 Then
        mnuAssessment(1).Enabled = True
        mnuAssessment(2).Enabled = True
        mnuAssessment(3).Enabled = True
    Else
        mnuAssessment(1).Enabled = False
        mnuAssessment(2).Enabled = False
        mnuAssessment(3).Enabled = False
    End If

End Sub

Private Sub able_form(enable As Boolean)
    Dim lvarControl As Control
    Dim lvarName As String
    
    For Each lvarControl In Me.Controls 'loop through form controls
        lvarName = UCase(TypeName(lvarControl))
        
        If lvarName <> "MENU" And lvarName <> "SHAPE" And lvarName <> "LINE" And lvarName <> "CALENDAR" And lvarName <> "COMMONDIALOG" And lvarName <> "MAPISESSION" And lvarName <> "MAPIMESSAGES" Then
            'MsgBox lvarName
            If UCase(lvarControl.Container.Name) <> "FRMMAIN" Then 'If they are in a  frame
                lvarControl.Enabled = enable
                
            End If
        End If
    Next
End Sub

Private Sub clear_form()
    Dim lvarControl As Control
    Dim lvarArrCounter As Long
    Dim lvarFSO As New FileSystemObject
    
    For Each lvarControl In Controls
        If TypeName(lvarControl) = "TextBox" Then
            lvarControl.Text = ""
        ElseIf TypeName(lvarControl) = "CheckBox" Then
            lvarControl.Value = 0
        'ElseIf TypeName(lvarControl) = "ComboBox" And lvarControl.Tag <> "" Then
        '   lvarControl.Clear
        'ElseIf TypeName(lvarControl) = "ComboBox" Then
        '   lvarControl.Clear
        'ElseIf TypeName(lvarControl) = "ListBox" Then
        '    lvarControl.Clear
        'ElseIf TypeName(lvarControl) = "CommandButton" Then
        ElseIf TypeName(lvarControl) = "image" Then
            lvarControl = LoadPicture
        End If
    Next
    
    'build combo lists
    build_lists
    
    'hide calendar controls
    Calendar1.Visible = False
    Calendar2.Visible = False
    Calendar3.Visible = False
    calASS_DATE_UPLIFTED.Visible = False
    calASS_PAID_DATE.Visible = False
    calASS_DATE_AUTHORISED.Visible = False
    
    'Keep Date In Assessment List
    txtDate = Calendar1.Value
    
    'Damage Picture
    picASS_DAMAGE_PICTURE.Cls
    If (lvarFSO.FileExists(VB.App.Path & "\blank.jpg")) Then
        picASS_DAMAGE_PICTURE.Picture = LoadPicture(VB.App.Path & "\blank.jpg")
    Else
        MsgBox "You are missing a blank.jpg in " & vbCrLf & VB.App.Path, vbOKOnly, "Error!"
        End
    End If
End Sub

Private Sub Form_Paint()
    If txtASS_INVOICE_NO.Enabled And txtASS_INVOICE_NO.Visible Then
        txtASS_INVOICE_NO.SetFocus
    End If
End Sub

Private Sub mnuLoad_Click()
    load_assessment
End Sub

Private Sub mnuNew_Click()
    Dim lvarQuery As String
    Dim lvarRS As DAO.Recordset
    Dim lvarFSO As New FileSystemObject
    Dim lvarCounter As Long
    Dim lvarFile As File
    Dim lvarFolder As Folder
    Dim lvarASS_KEY_NEW As String
    Dim lvarASS_KEY As String

    clear_form
    
    'Set assessed today
    txtASS_DATE_ASSESSED.Text = VBA.Date
    txtASS_DATE_INSTRUCTED.Text = VBA.Date
           
    'get max Key
    lvarQuery = "SELECT MAX (ASS_INVOICE_NO) FROM ASSESSMENT"
            
    Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenSnapshot)
    If lvarRS.EOF Then 'No previous assessments
         txtASS_INVOICE_NO = "0"
    Else
         txtASS_INVOICE_NO = IIf(IsNull(lvarRS(0).Value), "0", lvarRS(0).Value + 1)
    End If
            
    save_assessment
    list_assessments
            
    able_form True
End Sub

Private Sub mnuAssessment_Click(index As Integer)
    Dim lvarQuery As String
    Dim lvarRS As DAO.Recordset
    Dim lvarFSO As New FileSystemObject
    Dim lvarCounter As Long
    Dim lvarFile As File
    Dim lvarFolder As Folder
    Dim lvarASS_KEY_NEW As String
    Dim lvarASS_KEY As String
    
    Select Case index
        Case 1 'LOAD
            load_assessment
        Case 3 'RE-ASSESS
            load_assessment
            
            txtASS_DATE_INSTRUCTED.Text = VBA.Date
            txtASS_DATE_ASSESSED.Text = VBA.Date

            save_assessment True
            
            list_assessments
            able_form True
        Case 0 'NEW
            clear_form
    
            'Set assessed today
            txtASS_DATE_ASSESSED.Text = VBA.Date
            txtASS_DATE_INSTRUCTED.Text = VBA.Date
            
            'get max Key
            lvarQuery = "SELECT MAX (ASS_INVOICE_NO) FROM ASSESSMENT"
            
            Set lvarRS = gvarDatabase.OpenRecordset(lvarQuery, dbOpenSnapshot)
            If lvarRS.EOF Then 'No previous assessments
                txtASS_INVOICE_NO = "0"
            Else
                txtASS_INVOICE_NO = IIf(IsNull(lvarRS(0).Value), "0", lvarRS(0).Value + 1)
            End If
            
            save_assessment
            list_assessments
            
            able_form True
        Case 2 'DELETE
            If MsgBox("Are you sure you wish to delete the assessment: " & lstAssessments.List(lstAssessments.ListIndex), vbYesNo, "Delete Assessment") = vbYes Then
                lvarQuery = "DELETE FROM ASSESSMENT WHERE ASS_KEY = " & lstAssessments.ItemData(lstAssessments.ListIndex)
                gvarDatabase.Execute (lvarQuery)
                                
                'get rid of useless image
                If lvarFSO.FileExists(VB.App.Path & "\" & mvarASS_KEY & ".bmp") Then
                    lvarFSO.DeleteFile VB.App.Path & "\" & mvarASS_KEY & ".bmp", True
                End If
                
                If lvarFSO.FolderExists(gvarPhotoPath) Then
                    Set lvarFolder = lvarFSO.GetFolder(gvarPhotoPath)
                    'For Each lvarFile In lvarFolder.Files
                    '    If UCase(lvarFile.Name) Like "" & mvarASS_KEY & "P_#.???" Then
                    '        lvarFile.delete True
                    '    End If
                    'Next
                End If
                clear_form
                able_form False
                list_assessments
            End If
        
        Case Else
            ' not a valid choice throw error and die
    End Select
    'Rebuild Action Lists
    build_lists
    
    'Dim lvarQuery As String
    'Dim lvarRS As DAO.Recordset
    'Dim lvarFSO As New FileSystemObject
    'Dim lvarCounter As Long
    'Dim lvarFile As File
    Dim lvarAutoFilePath As String
    'Dim lvarFolder As Folder
    
    Select Case index
        Case 10 '"Generate Blank Report"
            repControl.filename = VB.App.Path & "\blank.rep"
            repControl.SetDatabaseConnectionString "ASSESSOR", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & VB.App.Path & "\assessment.mdb;Persist Security Info=False"
            repControl.SetParamValue "DMG_PIC", VB.App.Path & "\blank.jpg"
            repControl.Preview = False
            repControl.ShowPrintDialog = True
            repControl.ShowProgress = False
            
            CD2.filename = "blank.pdf"
            On Error GoTo errorhandler
            CD2.ShowSave
    
            If CD2.filename <> "" Then
                Call repControl.SaveToPDF(CD2.filename, False)
                'repControl.Execute
            End If
        Case 4 '"Save"
            'Save image
            txtASS_DAMAGE_PICTURE = mvarASS_KEY & ".jpg"
            SavePicture picASS_DAMAGE_PICTURE.Image, gvarDamagePath & txtASS_DAMAGE_PICTURE
            update_assessment 'photos also saved here
            file_photos mvarASS_KEY, True
            list_assessments
        Case 7 '"Authorisation Letter"
            If chkASS_AUTHORISED.Value = CheckBoxConstants.vbChecked Then
                repControl.filename = VB.App.Path & "\authorise.rep"
                repControl.SetDatabaseConnectionString "ASSESSOR", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & VB.App.Path & "\assessment.mdb;Persist Security Info=False"
                repControl.SetParamValue "VAR_ASS_KEY", mvarASS_KEY
                repControl.Preview = False
                repControl.ShowPrintDialog = True
                repControl.ShowProgress = False
                On Error GoTo errorhandler
                CD2.filename = txtASS_INVOICE_NO & "_auth.pdf"
                'CD2.FileTitle = txtASS_INVOICE_NO & ".pdf"
                CD2.ShowSave
                
                If CD2.filename <> "" Then
                    'Save to PDF
                    Call repControl.SaveToPDF(CD2.filename, False)
                    'Auto File PDF
                    If Not (file_pdf(CD2.filename, pthAuthorisations)) Then
                        MsgBox "Error: could not auto file the PDF!", vbOKOnly, "Error:"
                    End If
                    
                    'Set The Letter as generated
                    gvarDatabase.Execute "UPDATE ASSESSMENT SET ASS_DATE_AUTHORISED_SENT=true", dbOpenForwardOnly
                    'Email it
                    If MsgBox("Send as Email?", vbYesNo, "Email") = vbYes Then
                        send_mail "Authorisation Letter", "Authorisation Letter", "", CD2.filename
                    End If
                End If
            Else
                MsgBox "Error: Assessment(" & txtASS_INVOICE_NO & ") Not Yet Authorised!", vbOKOnly, "Error!"
            End If
        Case 6 '"Generate PDF"
            repControl.filename = VB.App.Path & "\report.rep"
            repControl.SetDatabaseConnectionString "ASSESSOR", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & VB.App.Path & "\assessment.mdb;Persist Security Info=False"
            repControl.SetParamValue "ASS_KEY", mvarASS_KEY
            repControl.SetParamValue "PIC_PATH", gvarPhotoPath
            repControl.SetParamValue "DMG_PATH", gvarDamagePath
            
            repControl.Preview = False
            repControl.ShowPrintDialog = True
            repControl.ShowProgress = False
            CD2.filename = txtASS_INVOICE_NO & ".pdf"
            'CD2.FileTitle = txtASS_INVOICE_NO & ".pdf"
            On Error GoTo errorhandler
            CD2.ShowSave
    
            If CD2.filename <> "" Then
                'Create report
                Call repControl.SaveToPDF(CD2.filename, False)
                
                'auto file the PDF
                If Not (file_pdf(CD2.FileTitle, pthReports)) Then
                    MsgBox "Error: could not auto file the PDF!", vbOKOnly, "Error:"
                End If
                
                'repControl.Execute
                gvarDatabase.Execute "UPDATE ASSESSMENT SET ASS_REPORTED=true", dbOpenForwardOnly
                
                'send by mail
                If MsgBox("Send as Email?", vbYesNo, "Email") = vbYes Then
                    send_mail "ASSESSMENT " & txtASS_INVOICE_NO, "ASSESSMENT " & txtASS_INVOICE_NO, "", CD2.filename
                End If
            End If
        'Case "Import Images"
        '    fetch_images
        Case 8 '"Status Flags"
            frmStatus.Show vbModal
            Fill_Form
        Case Else
            'not a valid choice throw error and die
    End Select
    
    'To Avoid Date Click
    If txtASS_INVOICE_NO.Enabled And txtASS_INVOICE_NO.Visible Then
        txtASS_INVOICE_NO.SetFocus
    End If
    
    Exit Sub
errorhandler:
    'do diddly
    MsgBox VBA.err.Number & ":" & VBA.err.Description
    On Error GoTo 0
End Sub

Private Sub mnuTools_Click(index As Integer)
    Dim lvarQuery As String
    Dim lvarRS As DAO.Recordset
    Dim lvarRS2 As DAO.Recordset
    Dim lvarFSO As New FileSystemObject
    Dim lvarCounter As Long
    Dim lvarFile As File
    Dim lvarFolder As Folder
    Dim lvarControl As Control
    Dim lvarPos As String
    Dim lvarKey As String
    Dim lvarTable As String
    Dim kvarControl As Control
    
    Select Case index
        Case 1 '"Reminders"
            Dim lvarFrm As New frmReminders
            lvarFrm.mvarASS_KEY = ""
            lvarFrm.mvarAction = ""
            lvarFrm.Show vbModal
        Case 4 '"Branch"
            frmBranch.Show vbModal
        Case 3 '"Insurance"
            frmInsurance.Show vbModal
        Case 5 '"Clark"
            frmClark.Show vbModal
        Case 6 '"Assessor"
            frmAssessor.Show vbModal
        Case 0 '"Monthly Reports"
            frmReports.Show vbModal
        Case 8 '"Configure"
            frmConfig.Show vbModal
        Case 7 '"Company"
            frmCompany.Show vbModal
        Case "Fix Data"
            If MsgBox("Fix Data?", vbYesNo, "Fix Data") = vbYes Then
                modDataFix.fix_data
            End If
        Case "Fix Images"
            If MsgBox("Fix Images?", vbYesNo, "Fix Images") = vbYes Then
                Set lvarControl = frmMain.Controls("PicFormat321")
                modDataFix.fix_images lvarControl
                'modDataFix.fix_images
            End If
        Case Else
            ' not a valid choice throw error and die
    End Select
    
    'Update things
    'rebuild foreign lists
    For Each lvarControl In Me.Controls
        If UCase(lvarControl.Name) Like "CMBFOR*" Then
            lvarPos = lvarControl.ListIndex 'Remember where we are
            lvarKey = Mid(lvarControl.Name, 8, 3) & "_KEY"
            lvarTable = Mid(lvarControl.Name, 12)
            
            lvarQuery = "SELECT * FROM " & lvarTable & " ORDER BY " & Mid(lvarControl.Name, 8, 3) & "_NAME"
            Set lvarRS2 = gvarDatabase.OpenRecordset(lvarQuery, dbOpenForwardOnly)
            Do While Not lvarRS2.EOF
                lvarControl.AddItem lvarRS2(Mid(lvarControl.Name, 8, 3) & "_NAME")
                lvarControl.ItemData(lvarControl.NewIndex) = lvarRS2(lvarKey)
                lvarRS2.MoveNext
            Loop
        
            lvarControl.ListIndex = lvarPos
        End If
    Next
    're list reminders
    check_reminders
End Sub

'Private Sub build_extras()
'    Dim lvarCounter As Long
'
'    txtASS_EXTRAS = ""
'    'build the extras textbox
'    For lvarCounter = 0 To lstASS_EXTRAS_LIST.ListCount - 1
'        If lstASS_EXTRAS_LIST.Selected(lvarCounter) Then
'            txtASS_EXTRAS = txtASS_EXTRAS & lstASS_EXTRAS_LIST.List(lvarCounter) & vbCrLf
'        End If
'    Next
'    'MsgBox txtASS_EXTRAS
'End Sub

'Private Sub build_extras_list()
'    'for when we load an assessment
'    Dim lvarCounter As Long
'    Dim lvarCounter2 As Long
'    Dim lvarSplitStr() As String
'
'    For lvarCounter2 = 0 To lstASS_EXTRAS_LIST.ListCount - 1
'        lstASS_EXTRAS_LIST.Selected(lvarCounter2) = False
'    Next
'
'    mvarLIST_CLICK = False
'    If txtASS_EXTRAS <> "" Then
'        lvarSplitStr = Split(txtASS_EXTRAS, vbCrLf)
'        'build the extras textbox
'        For lvarCounter = 0 To UBound(lvarSplitStr)
'            For lvarCounter2 = 0 To lstASS_EXTRAS_LIST.ListCount - 1
'                If lstASS_EXTRAS_LIST.List(lvarCounter2) = lvarSplitStr(lvarCounter) Then
'                    lstASS_EXTRAS_LIST.Selected(lvarCounter2) = True
'                End If
'            Next
'        Next
'    End If
'    mvarLIST_CLICK = True
'End Sub

Private Sub txtASS_ADDITIONALS_Validate(Cancel As Boolean)
    quotation_validate
End Sub

Private Sub txtASS_KILOMETRE_PERC_Click()
    txtASS_KILOMETRE_PERC.SelLength = Len(txtASS_KILOMETRE_PERC)
End Sub

Private Sub txtASS_SAVINGS_Click()
    txtASS_SAVINGS.SelLength = Len(txtASS_SAVINGS)
End Sub

'Private Sub lstASS_EXTRAS_LIST_Click()
    'rebuild extras
    'If mvarLIST_CLICK Then
    '    build_extras
    'End If
'End Sub

Private Sub lstAssessments_Click()
    build_go
End Sub

Private Sub lstAssessments_DblClick()
    If MsgBox("Load Assessment :" & lstAssessments.Text, vbYesNo, "Load Assessment") = vbYes Then
        load_assessment
    End If
End Sub

Private Sub lstAssessments_LostFocus()
    txtSEARCH.SetFocus
End Sub

Private Sub picASS_DAMAGE_PICTURE_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Select Case lstDamage.ListIndex
        Case 0:
            picASS_DAMAGE_PICTURE.CurrentX = X - (picASS_DAMAGE_PICTURE.TextWidth("X") / 2)
            picASS_DAMAGE_PICTURE.CurrentY = Y - (picASS_DAMAGE_PICTURE.TextHeight("X") / 2)
            picASS_DAMAGE_PICTURE.Print "X"
        Case 1:
            picASS_DAMAGE_PICTURE.CurrentX = X - (picASS_DAMAGE_PICTURE.TextWidth("///") / 2)
            picASS_DAMAGE_PICTURE.CurrentY = Y - (picASS_DAMAGE_PICTURE.TextHeight("///") / 2)
            picASS_DAMAGE_PICTURE.Print "///"
        Case 2:
            picASS_DAMAGE_PICTURE.CurrentX = X - (picASS_DAMAGE_PICTURE.TextWidth("<<<") / 2)
            picASS_DAMAGE_PICTURE.CurrentY = Y - (picASS_DAMAGE_PICTURE.TextHeight("<<<") / 2)
            picASS_DAMAGE_PICTURE.Print "<<<"
        Case 3:
            picASS_DAMAGE_PICTURE.CurrentX = X - (picASS_DAMAGE_PICTURE.TextWidth(">>>") / 2)
            picASS_DAMAGE_PICTURE.CurrentY = Y - (picASS_DAMAGE_PICTURE.TextHeight(">>>") / 2)
            picASS_DAMAGE_PICTURE.Print ">>>"
    End Select
End Sub

Private Sub picASS_PHOTO_Click(index As Integer)
    Dim lvarFSO As New FileSystemObject
    Dim lvarType() As String
    
    On Error GoTo errorhandler
    
    cd1.ShowOpen
    
    lvarType = Split(cd1.filename, ".")
    
    If cd1.filename <> "" Then
        Set picASS_PHOTO(index) = LoadPicture(cd1.filename)
        lvarFSO.CopyFile cd1.filename, gvarPhotoPath & mvarASS_KEY & "_" & Str(index + 1) & "." & lvarType(UBound(lvarType)), True
        txtASS_PHOTO(index) = mvarASS_KEY & "_" & Str(index + 1) & "." & lvarType(UBound(lvarType))
        
        'lblASS_PHOTO_1.Caption = VB.App.Path & "\photos\" & mvarASS_KEY & "p_1." & lvarType(1)
        'lblASS_PHOTO_1.ToolTipText = VB.App.Path & "\photos\" & mvarASS_KEY & "p_1." & lvarType(1)
    End If
    
    On Error GoTo 0
    Exit Sub
errorhandler:
    'do diddly squat
    On Error GoTo 0
End Sub

Private Sub tabMain_Click()
    'Hide all
    frmAssessment.Visible = False
    frmVehicle.Visible = False
    frmNotes.Visible = False
    frmPhotos.Visible = False
    frmPhotos2.Visible = False
    frmPhotos3.Visible = False
    frmCosting.Visible = False
    frmReminders.Visible = False
    
    'Show the correct Form
    If tabMain.SelectedItem.index = 1 Then
        frmAssessment.Visible = True
    ElseIf tabMain.SelectedItem.index = 2 Then
        frmVehicle.Visible = True
    ElseIf tabMain.SelectedItem.index = 3 Then
        frmNotes.Visible = True
    ElseIf tabMain.SelectedItem.index = 4 Then
        frmCosting.Visible = True
    ElseIf tabMain.SelectedItem.index = 5 Then
        frmPhotos.Visible = True
    ElseIf tabMain.SelectedItem.index = 6 Then
        frmPhotos2.Visible = True
    ElseIf tabMain.SelectedItem.index = 7 Then
        frmPhotos3.Visible = True
    Else
        frmReminders.Visible = True
    End If
End Sub

Private Sub market_validate()
    
    If txtASS_TRADE_IN <> "" And txtASS_RETAIL <> "" Then
        txtASS_MARKET = (Val(txtASS_TRADE_IN) + Val(txtASS_RETAIL)) / 2
        If txtASS_KILOMETRE_PERC <> "" Then
            txtASS_KILOMETRE = Val(txtASS_MARKET) * (Val(txtASS_KILOMETRE_PERC) / 100)
        End If
        If txtASS_OLD_DAMAGE <> "" Then
            txtASS_MARKET = Val(txtASS_MARKET) - Val(txtASS_OLD_DAMAGE)
        End If
        If txtASS_KILOMETRE <> "" Then
            txtASS_MARKET = Val(txtASS_MARKET) + Val(txtASS_KILOMETRE)
        End If
        txtASS_OLD_DAMAGE = Format(txtASS_OLD_DAMAGE, "###0.00")
        txtASS_KILOMETRE = Format(txtASS_KILOMETRE, "###0.00")
        txtASS_TRADE_IN = Format(txtASS_TRADE_IN, "###0.00")
        txtASS_RETAIL = Format(txtASS_RETAIL, "###0.00")
        txtASS_MARKET = Format(txtASS_MARKET, "###0.00")
    End If
End Sub

Private Sub assessment_validate()
    If txtASS_ASSESS_RATE <> "" And IsNumeric(txtASS_ASSESS_RATE) Then
        txtASS_ASSESS_SUB_TOTAL = txtASS_ASSESS_RATE
        If txtASS_ASSESS_KILOMETRES <> "" And IsNumeric(txtASS_ASSESS_KILOMETRES) And IsNumeric(txtASS_RATE_PER_KILOMETER) Then
            txtASS_ASSESS_KILOMETRES_COST = Val(txtASS_RATE_PER_KILOMETER) * Val(txtASS_ASSESS_KILOMETRES)
        End If
        If txtASS_ASSESS_KILOMETRES_COST <> "" And IsNumeric(txtASS_ASSESS_KILOMETRES_COST) Then
            txtASS_ASSESS_SUB_TOTAL = Val(txtASS_ASSESS_SUB_TOTAL) + Val(txtASS_ASSESS_KILOMETRES_COST)
        End If
        If txtASS_ASSESS_SUB_TOTAL <> "" And IsNumeric(txtASS_ASSESS_SUB_TOTAL) Then
            txtASS_ASSESS_VAT = Val(txtASS_ASSESS_SUB_TOTAL) * 0.14
            txtASS_ASSESS_TOTAL = Val(txtASS_ASSESS_SUB_TOTAL) * 1.14
        End If
        
        txtASS_ASSESS_RATE = Format(txtASS_ASSESS_RATE, "###0.00")
        txtASS_ASSESS_KILOMETRES_COST = Format(txtASS_ASSESS_KILOMETRES_COST, "###0.00")
        txtASS_ASSESS_SUB_TOTAL = Format(txtASS_ASSESS_SUB_TOTAL, "###0.00")
        txtASS_ASSESS_VAT = Format(txtASS_ASSESS_VAT, "###0.00")
        txtASS_ASSESS_TOTAL = Format(txtASS_ASSESS_TOTAL, "###0.00")
    Else
        txtASS_ASSESS_SUB_TOTAL = 0
        txtASS_ASSESS_VAT = 0
        txtASS_ASSESS_TOTAL = 0
    End If
End Sub

Private Sub quotation_validate()
    
    If txtASS_AMOUNT_AGREED <> "" And IsNumeric(txtASS_AMOUNT_AGREED) Then
        
        If txtASS_SAVINGS = "" Or Not IsNumeric(txtASS_SAVINGS) Then
            txtASS_SAVINGS = 0
        End If
        If txtASS_ADDITIONALS = "" Or Not IsNumeric(txtASS_ADDITIONALS) Then
            txtASS_ADDITIONALS = 0
        End If

        'txtASS_AMOUNT_AGREED = Val(txtASS_AMOUNT_QUOTED / 1.14)
        txtASS_SUB_TOTAL_1 = (txtASS_AMOUNT_AGREED - txtASS_SAVINGS + txtASS_ADDITIONALS)
        
        'If txtASS_AMOUNT_AGREED <> "" And IsNumeric(txtASS_AMOUNT_AGREED) Then
        '    txtASS_SUB_TOTAL_1 = txtASS_SUB_TOTAL_1 + Val(txtASS_AMOUNT_AGREED)
        'End If
        
        If txtASS_DISCOUNT_PERC <> "" And IsNumeric(txtASS_DISCOUNT_PERC) Then
            txtASS_DISCOUNT = (Val(txtASS_DISCOUNT_PERC) / 100) * Val(txtASS_AMOUNT_AGREED)
        End If
        
        If txtASS_DISCOUNT <> "" And IsNumeric(txtASS_DISCOUNT) Then
            txtASS_SUB_TOTAL_1 = Val(txtASS_SUB_TOTAL_1) - Val(txtASS_DISCOUNT)
        End If
        
        If txtASS_BETTERMENT <> "" And IsNumeric(txtASS_BETTERMENT) Then
            txtASS_SUB_TOTAL_1 = Val(txtASS_SUB_TOTAL_1) - Val(txtASS_BETTERMENT)
        End If
        
        If txtASS_SUB_TOTAL_1 <> "" And IsNumeric(txtASS_SUB_TOTAL_1) Then
            txtASS_VAT = Val(txtASS_SUB_TOTAL_1) * 0.14
            txtASS_SUB_TOTAL_2 = Val(txtASS_SUB_TOTAL_1) * 1.14
        End If
        
        If txtASS_EXCESS <> "" And IsNumeric(txtASS_EXCESS) Then
            txtASS_TOTAL = Val(txtASS_SUB_TOTAL_2) - Val(txtASS_EXCESS)
        Else
            txtASS_TOTAL = txtASS_SUB_TOTAL_2
        End If
        
        txtASS_SAVINGS = Format(txtASS_SAVINGS, "###0.00")
        txtASS_ADDITIONALS = Format(txtASS_ADDITIONALS, "###0.00")
        
        txtASS_AMOUNT_QUOTED = Format(txtASS_AMOUNT_QUOTED, "###0.00")
        txtASS_AMOUNT_AGREED = Format(txtASS_AMOUNT_AGREED, "###0.00")
        txtASS_DISCOUNT = Format(txtASS_DISCOUNT, "###0.00")
        txtASS_BETTERMENT = Format(txtASS_BETTERMENT, "###0.00")
        
        txtASS_EXCESS = Format(txtASS_EXCESS, "###0.00")
        txtASS_SUB_TOTAL_1 = Format(txtASS_SUB_TOTAL_1, "###0.00")
        txtASS_VAT = Format(txtASS_VAT, "####.00")
        txtASS_SUB_TOTAL_2 = Format(txtASS_SUB_TOTAL_2, "###0.00")
        txtASS_TOTAL = Format(txtASS_TOTAL, "###0.00")
    Else
        txtASS_SUB_TOTAL_1 = 0
        txtASS_VAT = 0
        txtASS_SUB_TOTAL_2 = 0
        txtASS_TOTAL = 0
    End If
End Sub

Private Sub txtASS_ADDITIONALS_GotFocus()
    txtASS_ADDITIONALS.SelLength = Len(txtASS_ADDITIONALS)
End Sub

Private Sub txtASS_ADDITIONALS_Click()
    txtASS_ADDITIONALS.SelLength = Len(txtASS_ADDITIONALS)
End Sub


Private Sub txtASS_AMOUNT_AGREED_GotFocus()
    txtASS_AMOUNT_AGREED.SelLength = Len(txtASS_AMOUNT_AGREED)
End Sub

Private Sub txtASS_AMOUNT_AGREED_Click()
    txtASS_AMOUNT_AGREED.SelLength = Len(txtASS_AMOUNT_AGREED)
End Sub

Private Sub txtASS_AMOUNT_AGREED_Validate(Cancel As Boolean)
    quotation_validate
End Sub

Private Sub txtASS_AMOUNT_QUOTED_GotFocus()
    txtASS_AMOUNT_QUOTED.SelLength = Len(txtASS_AMOUNT_QUOTED)
End Sub

Private Sub txtASS_AMOUNT_QUOTED_Click()
    txtASS_AMOUNT_QUOTED.SelLength = Len(txtASS_AMOUNT_QUOTED)
End Sub

Private Sub txtASS_AMOUNT_QUOTED_Validate(Cancel As Boolean)
    quotation_validate
End Sub

Private Sub txtASS_ASSESS_KILOMETRES_COST_Validate(Cancel As Boolean)
    assessment_validate
End Sub

Private Sub txtASS_ASSESS_KILOMETRES_Validate(Cancel As Boolean)
    assessment_validate
End Sub

Private Sub txtASS_KILOMETRE_PERC_GotFocus()
    txtASS_KILOMETRE_PERC.SelLength = Len(txtASS_KILOMETRE_PERC)
End Sub

Private Sub txtASS_OLD_DAMAGE_GotFocus()
    txtASS_OLD_DAMAGE.SelLength = Len(txtASS_OLD_DAMAGE)
End Sub

Private Sub txtASS_OLD_DAMAGE_Click()
    txtASS_OLD_DAMAGE.SelLength = Len(txtASS_OLD_DAMAGE)
End Sub


Private Sub txtASS_RATE_PER_KILOMETER_Validate(Cancel As Boolean)
    assessment_validate
End Sub

Private Sub txtASS_ASSESS_RATE_Validate(Cancel As Boolean)
    assessment_validate
End Sub

Private Sub txtASS_BETTERMENT_Validate(Cancel As Boolean)
    quotation_validate
End Sub

Private Sub txtASS_BETTERMENT_Click()
    txtASS_BETTERMENT.SelLength = Len(txtASS_BETTERMENT)
End Sub

Private Sub txtASS_BETTERMENT_GotFocus()
    txtASS_BETTERMENT.SelLength = Len(txtASS_BETTERMENT)
End Sub

Private Sub txtASS_BETTERMENT_PERC_Validate(Cancel As Boolean)
    quotation_validate
End Sub

Private Sub txtASS_PAID_DATE_Click()
    If chkASS_PAID.Value = 1 Then
        If txtASS_PAID_DATE <> "" Then
            calASS_PAID_DATE.Value = txtASS_PAID_DATE
        End If
        calASS_PAID_DATE.Visible = True
        calASS_PAID_DATE.SetFocus
    Else
        chkASS_PAID.SetFocus
    End If
End Sub

Private Sub txtASS_DATE_UPLIFTED_Click()
    If txtASS_DATE_UPLIFTED <> "" Then
        calASS_DATE_UPLIFTED.Value = txtASS_DATE_UPLIFTED
    End If
    calASS_DATE_UPLIFTED.Visible = True
    calASS_DATE_UPLIFTED.SetFocus
End Sub

Private Sub txtASS_DATE_AUTHORISED_Click()
    If chkASS_AUTHORISED.Value = 1 Then
        If txtASS_DATE_AUTHORISED <> "" Then
            calASS_DATE_AUTHORISED.Value = txtASS_DATE_AUTHORISED
        End If
        calASS_DATE_AUTHORISED.Visible = True
        calASS_DATE_AUTHORISED.SetFocus
    End If
End Sub

Private Sub txtASS_DISCOUNT_Validate(Cancel As Boolean)
    quotation_validate
End Sub

Private Sub txtASS_DISCOUNT_Click()
    txtASS_DISCOUNT.SelLength = Len(txtASS_DISCOUNT)
End Sub

Private Sub txtASS_DISCOUNT_GotFocus()
    'quotation_validate
    txtASS_DISCOUNT.SelLength = Len(txtASS_DISCOUNT)
End Sub

Private Sub txtASS_DISCOUNT_PERC_Click()
    'quotation_validate
    txtASS_DISCOUNT_PERC.SelLength = Len(txtASS_DISCOUNT_PERC)
End Sub

Private Sub txtASS_DISCOUNT_PERC_GotFocus()
    'quotation_validate
    txtASS_DISCOUNT_PERC.SelLength = Len(txtASS_DISCOUNT_PERC)
End Sub

Private Sub txtASS_DISCOUNT_PERC_Validate(Cancel As Boolean)
    quotation_validate
End Sub

Private Sub txtASS_EXCESS_Validate(Cancel As Boolean)
    quotation_validate
End Sub

Private Sub txtASS_EXCESS_Click()
    txtASS_EXCESS.SelLength = Len(txtASS_EXCESS)
End Sub

Private Sub txtASS_KILOMETRE_Click()
    txtASS_KILOMETRE.SelLength = Len(txtASS_KILOMETRE)
End Sub

Private Sub txtASS_KILOMETRE_GotFocus()
    txtASS_KILOMETRE.SelLength = Len(txtASS_KILOMETRE)
    'DoEvents
    'Calendar2.Visible = False
    'Calendar3.Visible = False
End Sub

Private Sub txtASS_KILOMETRE_Validate(Cancel As Boolean)
    market_validate
End Sub

Private Sub txtASS_KILOMETRE_PERC_Validate(Cancel As Boolean)
    market_validate
End Sub

Private Sub txtASS_OLD_DAMAGE_Validate(Cancel As Boolean)
    market_validate
End Sub

Private Sub txtASS_RETAIL_GotFocus()
    txtASS_RETAIL.SelLength = Len(txtASS_RETAIL)
End Sub

Private Sub txtASS_RETAIL_Click()
    txtASS_RETAIL.SelLength = Len(txtASS_RETAIL)
End Sub

Private Sub txtASS_RETAIL_Validate(Cancel As Boolean)
    market_validate
End Sub



Private Sub txtASS_SAVINGS_Validate(Cancel As Boolean)
    quotation_validate
End Sub

Private Sub txtASS_TRADE_IN_GotFocus()
    txtASS_TRADE_IN.SelLength = Len(txtASS_TRADE_IN)
End Sub

Private Sub txtASS_TRADE_IN_Click()
    txtASS_TRADE_IN.SelLength = Len(txtASS_TRADE_IN)
End Sub

Private Sub txtASS_TRADE_IN_Validate(Cancel As Boolean)
    market_validate
End Sub

Private Sub txtDate_Change()
    'make the date selection easy
    If txtDate <> "" And cmbFILTER.ListCount > 0 Then
        'MsgBox txtDate
        cmbFILTER.ListIndex = 0
        list_assessments
    End If
End Sub

Private Sub txtDate_GotFocus()
    'optSelectAssessments(1).Value = True
    Calendar1.Visible = True
    Calendar1.SetFocus
End Sub

Private Sub txtASS_DATE_INSTRUCTED_GotFocus()
    Calendar2.Value = IIf(txtASS_DATE_INSTRUCTED = "", VBA.Date, txtASS_DATE_INSTRUCTED)
    Calendar2.Visible = True
    Calendar2.SetFocus
    'DoEvents
End Sub

Private Sub txtASS_DATE_ASSESSED_GotFocus()
    'TODO: set calendar to me
    'TODO: Fix calendar probs
    Calendar3.Value = IIf(txtASS_DATE_ASSESSED = "", VBA.Date, txtASS_DATE_ASSESSED)
    Calendar3.Visible = True
    Calendar3.SetFocus
    'DoEvents
End Sub
